]> spindle.queued.net Git - midori/commitdiff
Remove items from the transferbar when they are opened
authorChristian Dywan <christian@twotoasts.de>
Fri, 20 Mar 2009 23:11:29 +0000 (00:11 +0100)
committerChristian Dywan <christian@twotoasts.de>
Fri, 20 Mar 2009 23:11:29 +0000 (00:11 +0100)
midori/midori-browser.c

index a92278ddff69b6a52f71f4d056fee946ee72a817..acdad2461768e16a91a42f79f9a73bbfd2bf85e9 100644 (file)
@@ -939,13 +939,16 @@ midori_browser_download_button_clicked_cb (GtkWidget*      button,
         case WEBKIT_DOWNLOAD_STATUS_FINISHED:
         {
             const gchar* uri = webkit_download_get_destination_uri (download);
-            if (!gtk_show_uri (gtk_widget_get_screen (button),
-                uri, gtk_get_current_event_time (), NULL))
+            gboolean success = gtk_show_uri (gtk_widget_get_screen (button),
+                uri, gtk_get_current_event_time (), NULL);
+            if (!success)
             {
                 gchar* command = g_strconcat ("exo-open ", uri, NULL);
-                g_spawn_command_line_async (command, NULL);
+                success = g_spawn_command_line_async (command, NULL);
                 g_free (command);
             }
+            if (success)
+                gtk_widget_destroy (gtk_widget_get_parent (button));
             break;
         }
         default: