[evince] shell: Use GAppInfo to launch evince-previewer instead of gdk_spawn
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] shell: Use GAppInfo to launch evince-previewer instead of gdk_spawn
- Date: Thu, 23 Dec 2010 17:17:17 +0000 (UTC)
commit fa091bc8b0aeb73ce9fc836aa45baf8b79892e3b
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Dec 23 18:07:53 2010 +0100
shell: Use GAppInfo to launch evince-previewer instead of gdk_spawn
shell/main.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/shell/main.c b/shell/main.c
index 7d4fb0d..ab4b8df 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]