aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-main-window.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-12-23 20:36:50 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-12-23 20:36:50 +0800
commit8cf5f1c4f4224bc8863ab498c4d89082db6ceb7b (patch)
treed3e7db45bdc0d6ebe943c084a766cbfde948630d /src/empathy-main-window.c
parenta5c7ff32a6f9672ca78a4aca5a4dcf7554fc24f1 (diff)
downloadgsoc2013-empathy-8cf5f1c4f4224bc8863ab498c4d89082db6ceb7b.tar
gsoc2013-empathy-8cf5f1c4f4224bc8863ab498c4d89082db6ceb7b.tar.gz
gsoc2013-empathy-8cf5f1c4f4224bc8863ab498c4d89082db6ceb7b.tar.bz2
gsoc2013-empathy-8cf5f1c4f4224bc8863ab498c4d89082db6ceb7b.tar.lz
gsoc2013-empathy-8cf5f1c4f4224bc8863ab498c4d89082db6ceb7b.tar.xz
gsoc2013-empathy-8cf5f1c4f4224bc8863ab498c4d89082db6ceb7b.tar.zst
gsoc2013-empathy-8cf5f1c4f4224bc8863ab498c4d89082db6ceb7b.zip
main-window: use g_app_info_launch() instead of gdk_spawn_on_screen() (#637854)
Diffstat (limited to 'src/empathy-main-window.c')
-rw-r--r--src/empathy-main-window.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index b1e26f5e5..e0b05531b 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -1481,9 +1481,9 @@ main_window_help_debug_cb (GtkAction *action,
{
GdkScreen *screen = gdk_screen_get_default ();
GError *error = NULL;
- gchar *argv[2] = { NULL, };
- gint i = 0;
gchar *path;
+ GAppInfo *app_info;
+ GdkAppLaunchContext *context;
g_return_if_fail (GDK_IS_SCREEN (screen));
@@ -1496,17 +1496,26 @@ main_window_help_debug_cb (GtkAction *action,
path = g_build_filename (BIN_DIR, "empathy-debugger", NULL);
}
- argv[i++] = path;
+ app_info = g_app_info_create_from_commandline (path, NULL, 0, &error);
+ if (app_info == NULL) {
+ DEBUG ("Failed to create app info: %s", error->message);
+ g_error_free (error);
+ goto out;
+ }
- gdk_spawn_on_screen (screen, NULL, argv, NULL,
- G_SPAWN_SEARCH_PATH,
- NULL, NULL, NULL, &error);
+ context = gdk_app_launch_context_new ();
+ gdk_app_launch_context_set_display (context, gdk_screen_get_display (screen));
- if (error) {
+ if (!g_app_info_launch (app_info, NULL, (GAppLaunchContext *) context,
+ &error)) {
g_warning ("Failed to open debug window: %s", error->message);
g_error_free (error);
+ goto out;
}
+out:
+ tp_clear_object (&app_info);
+ tp_clear_object (&context);
g_free (path);
}