summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2010-12-23 15:23:40 -0500
committerShaun McCance <shaunm@gnome.org>2010-12-23 15:24:32 -0500
commit9bc4246fc52a6462ceebfca590a0f00f5c0a7b9a (patch)
tree1a3a4a6db1e0c56f66525567b6a7c53ba84ee122
parentbea13d1bab9618dfe3241a2cfc2b2535a4015932 (diff)
downloadyelp-9bc4246fc52a6462ceebfca590a0f00f5c0a7b9a.tar.gz
[libyelp/yelp-view] Use GAppLaunchContext instead of gdk_spawn
-rw-r--r--libyelp/yelp-view.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c
index c2b80ebd..e30d2639 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;