summaryrefslogtreecommitdiff
path: root/shell/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/main.c')
-rw-r--r--shell/main.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/shell/main.c b/shell/main.c
index 7f00c6f9..3164d3da 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -92,8 +92,6 @@ launch_previewer (void)
{
GString *cmd_str;
gchar *cmd;
- gint argc;
- gchar **argv;
gboolean retval = FALSE;
GError *error = NULL;
@@ -123,16 +121,16 @@ launch_previewer (void)
}
cmd = g_string_free (cmd_str, FALSE);
- g_shell_parse_argv (cmd, &argc, &argv, &error);
- g_free (cmd);
if (!error) {
- retval = gdk_spawn_on_screen (gdk_screen_get_default (),
- NULL, argv, NULL,
- G_SPAWN_SEARCH_PATH,
- NULL, NULL, NULL,
- &error);
- g_strfreev (argv);
+ GAppInfo *app;
+
+ app = g_app_info_create_from_commandline (cmd, NULL, 0, &error);
+
+ if (app != NULL) {
+ retval = g_app_info_launch (app, NULL, NULL, &error);
+ g_object_unref (app);
+ }
}
if (error) {
@@ -140,6 +138,8 @@ launch_previewer (void)
g_error_free (error);
}
+ g_free (cmd);
+
return retval;
}
@@ -260,9 +260,11 @@ main (int argc, char *argv[])
}
#endif
+#if !GLIB_CHECK_VERSION (2, 32, 0)
/* Init glib threads asap */
if (!g_thread_supported ())
g_thread_init (NULL);
+#endif
#ifdef ENABLE_NLS
/* Initialize the i18n stuff */