From 8cf036faffe5985d34c310ee89b133200380b757 Mon Sep 17 00:00:00 2001 From: Adam Petaccia Date: Wed, 6 May 2009 11:01:32 -0400 Subject: =?UTF-8?q?Bug=20571496=20=E2=80=93=20Migrate=20from=20deprecated?= =?UTF-8?q?=20gnome=5Fexecute=20to=20g=5Fspawn/xdg-terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/e-shell-window-commands.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'shell') diff --git a/shell/e-shell-window-commands.c b/shell/e-shell-window-commands.c index 224dd67171..289c5cbea8 100644 --- a/shell/e-shell-window-commands.c +++ b/shell/e-shell-window-commands.c @@ -27,7 +27,6 @@ #include #include -#include #include #include @@ -60,27 +59,25 @@ /* Utility functions. */ static void -launch_pilot_settings (const char *extra_arg) +launch_pilot_settings (void) { - char *args[] = { - "gpilotd-control-applet", - (char *) extra_arg, - NULL - }; - int pid; - - args[0] = g_find_program_in_path ("gpilotd-control-applet"); - if (!args[0]) { + GError* error = NULL; + + gchar* args = g_find_program_in_path ("gpilotd-control-applet"); + if (args == NULL) { e_notice (NULL, GTK_MESSAGE_ERROR, - _("The GNOME Pilot tools do not appear to be installed on this system.")); + _("The GNOME Pilot tools do not appear to be installed on this system.")); return; - } + } - pid = gnome_execute_async (NULL, extra_arg ? 2 : 1, args); - g_free (args[0]); + g_spawn_command_line_async (args, &error); + g_free (args); - if (pid == -1) - e_notice (NULL, GTK_MESSAGE_ERROR, _("Error executing %s."), args[0]); + if (error != NULL) { + e_notice (NULL, GTK_MESSAGE_ERROR, + _("Error executing %s. (%s)"), args, error->message); + g_error_free (error); + } } @@ -1082,7 +1079,7 @@ command_pilot_settings (BonoboUIComponent *uih, EShellWindow *window, const char *path) { - launch_pilot_settings (NULL); + launch_pilot_settings (); } -- cgit v1.2.3