Remove 'filename' argument from sokoke_spawn_program
This commit is contained in:
parent
120c5bf40f
commit
e74f89f8c2
5 changed files with 15 additions and 16 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue