From: Christian Dywan Date: Sun, 10 Oct 2010 11:27:06 +0000 (+0200) Subject: Remove 'filename' argument from sokoke_spawn_program X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e74f89f8c23a474b85b1ffc675a6f164fa04631e;p=midori Remove 'filename' argument from sokoke_spawn_program --- diff --git a/extensions/addons.c b/extensions/addons.c index 3c62c39a..7c6e7dd2 100644 --- a/extensions/addons.c +++ b/extensions/addons.c @@ -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); } } diff --git a/midori/midori-browser.c b/midori/midori-browser.c index b9ed4304..f35a10fc 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -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; } diff --git a/midori/midori-view.c b/midori/midori-view.c index cd53bd35..92628a79 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -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 diff --git a/midori/sokoke.c b/midori/sokoke.c index 02a623ac..5e7b9a63 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -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); } diff --git a/midori/sokoke.h b/midori/sokoke.h index a5c94be1..2cceee85 100644 --- a/midori/sokoke.h +++ b/midori/sokoke.h @@ -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);