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);
}
}
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,
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);
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;
}
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
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
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;
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);
}
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);