]> spindle.queued.net Git - midori/commitdiff
Remove 'filename' argument from sokoke_spawn_program
authorChristian Dywan <christian@twotoasts.de>
Sun, 10 Oct 2010 11:27:06 +0000 (13:27 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 10 Oct 2010 11:27:06 +0000 (13:27 +0200)
extensions/addons.c
midori/midori-browser.c
midori/midori-view.c
midori/sokoke.c
midori/sokoke.h

index 3c62c39a0e5be43cf1679298ce296ae6ace1533d..7c6e7dd22b30550a3ba0ebd1244e6c5099755e51 100644 (file)
@@ -291,22 +291,23 @@ midori_addons_open_in_editor_clicked_cb (GtkWidget* toolitem,
         MidoriWebSettings* settings;
         MidoriBrowser* browser;
         gchar* text_editor;
-        gchar* element_uri;
 
         browser = midori_browser_get_for_widget (GTK_WIDGET (addons->treeview));
         settings = katze_object_get_object (browser, "settings");
 
         gtk_tree_model_get (model, &iter, 0, &element, -1);
-        element_uri = g_filename_to_uri (element->fullpath, NULL, NULL);
 
         g_object_get (settings, "text-editor", &text_editor, NULL);
         if (text_editor && *text_editor)
-            sokoke_spawn_program (text_editor, element_uri, TRUE);
+            sokoke_spawn_program (text_editor, element->fullpath);
         else
+        {
+            gchar* element_uri = g_filename_to_uri (element->fullpath, NULL, NULL);
             sokoke_show_uri (NULL, element_uri,
                              gtk_get_current_event_time (), NULL);
+            g_free (element_uri);
+        }
 
-        g_free (element_uri);
         g_free (text_editor);
     }
 }
index b9ed43042834fa2d679d8dfb821bcbb35ed0f17d..f35a10fce1d6bd232e064af80ce900a404768e77 100644 (file)
@@ -2228,7 +2228,7 @@ midori_browser_subscribe_to_news_feed (MidoriBrowser* browser,
                                        const gchar*   uri)
 {
     if (browser->news_aggregator && *browser->news_aggregator)
-        sokoke_spawn_program (browser->news_aggregator, uri, FALSE);
+        sokoke_spawn_program (browser->news_aggregator, uri);
     else
     {
         gchar* description = g_strdup_printf ("%s\n\n%s", uri,
@@ -3262,7 +3262,7 @@ midori_browser_source_transfer_cb (KatzeNetRequest* request,
                 g_object_get (browser->settings,
                     "text-editor", &text_editor, NULL);
                 if (text_editor && *text_editor)
-                    sokoke_spawn_program (text_editor, unique_filename, TRUE);
+                    sokoke_spawn_program (text_editor, unique_filename);
                 else
                     sokoke_show_uri (NULL, unique_filename,
                                      gtk_get_current_event_time (), NULL);
@@ -3326,7 +3326,7 @@ _action_source_view_activate (GtkAction*     action,
     if (g_str_has_prefix (uri, "file://"))
     {
         gchar* filename = g_filename_from_uri (uri, NULL, NULL);
-        sokoke_spawn_program (text_editor, filename, TRUE);
+        sokoke_spawn_program (text_editor, filename);
         g_free (filename);
         return;
     }
index cd53bd3529a169b71f8afa014304c7ee0e2ef44a..92628a7960bbb9879f6c57ec8468c505d3bb40a2 100644 (file)
@@ -1791,7 +1791,7 @@ midori_web_view_menu_video_download_activate_cb (GtkWidget*  widget,
                                                  MidoriView* view)
 {
     gchar* uri = katze_object_get_string (view->hit_test, "media-uri");
-    sokoke_spawn_program (view->download_manager, uri, FALSE);
+    sokoke_spawn_program (view->download_manager, uri);
     g_free (uri);
 }
 #endif
@@ -1878,7 +1878,7 @@ static void
 midori_web_view_menu_download_activate_cb (GtkWidget*  widget,
                                            MidoriView* view)
 {
-    sokoke_spawn_program (view->download_manager, view->link_uri, FALSE);
+    sokoke_spawn_program (view->download_manager, view->link_uri);
 }
 
 static void
index 02a623ac96c3d14f2e09ab9309332e6e4be0427a..5e7b9a6304b75a34da637138a396c60d9d1edec4 100644 (file)
@@ -375,15 +375,14 @@ sokoke_show_uri (GdkScreen*   screen,
 
 gboolean
 sokoke_spawn_program (const gchar* command,
-                      const gchar* argument,
-                      gboolean     filename)
+                      const gchar* argument)
 {
     GError* error;
 
     g_return_val_if_fail (command != NULL, FALSE);
     g_return_val_if_fail (argument != NULL, FALSE);
 
-    if (filename)
+    if (!g_strstr_len (argument, 8, "://"))
     {
         gboolean success;
 
@@ -494,7 +493,7 @@ sokoke_spawn_app (const gchar* uri)
     gchar* quoted = g_shell_quote (executable);
     gchar* command = g_strconcat (quoted, " -a", NULL);
     g_free (quoted);
-    sokoke_spawn_program (command, uri, FALSE);
+    sokoke_spawn_program (command, uri);
     g_free (command);
 }
 
index a5c94be18cb1373b878a27d8a3ec6f300c33b714..2cceee8593dac48827285fc4917ba1b978880cec 100644 (file)
@@ -98,9 +98,8 @@ sokoke_show_uri                         (GdkScreen*      screen,
                                          GError**        error);
 
 gboolean
-sokoke_spawn_program                    (const gchar*    command,
-                                         const gchar*    argument,
-                                         gboolean        quote);
+sokoke_spawn_program                    (const gchar* command,
+                                         const gchar* argument);
 
 void
 sokoke_spawn_app                        (const gchar*    uri);