[yelp] [libyelp/yelp-view] Use GAppLaunchContext instead of gdk_spawn



commit 9bc4246fc52a6462ceebfca590a0f00f5c0a7b9a
Author: Shaun McCance <shaunm gnome org>
Date:   Thu Dec 23 15:23:40 2010 -0500

    [libyelp/yelp-view] Use GAppLaunchContext instead of gdk_spawn

 libyelp/yelp-view.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c
index c2b80eb..e30d263 100644
--- a/libyelp/yelp-view.c
+++ b/libyelp/yelp-view.c
@@ -861,13 +861,26 @@ popup_send_image (GtkMenuItem *item,
                   YelpView    *view)
 {
     gchar *command;
+    GAppInfo *app;
+    GAppLaunchContext *context;
+    GError *error = NULL;
     YelpViewPrivate *priv = GET_PRIV (view);
 
     command = g_strdup_printf ("%s %s", nautilus_sendto, priv->popup_image_uri);
+    context = (GAppLaunchContext *) gdk_app_launch_context_new ();
+
+    app = g_app_info_create_from_commandline (command, NULL, 0, &error);
+    if (app) {
+        g_app_info_launch (app, NULL, context, &error);
+        g_object_unref (app);
+    }
 
-    gdk_spawn_command_line_on_screen (gtk_widget_get_screen (GTK_WIDGET (view)),
-                                      command, NULL);
+    if (error) {
+        g_debug ("Could not launch nautilus-sendto: %s", error->message);
+        g_error_free (error);
+    }
 
+    g_object_unref (context);
     g_free (command);
     g_free (priv->popup_image_uri);
     priv->popup_image_uri = NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]