[gnome-commander/gcmd-1-3] Fixed problem #571495 (replacing deprecated gnome_execute_shell() with g_spawn_async()), 1/3



commit 509b15210446ae2e24d20116412cd48a342b79ce
Author: Ilya B <concious mail ru>
Date:   Thu Jul 2 23:53:07 2009 +0200

    Fixed problem #571495 (replacing deprecated gnome_execute_shell() with g_spawn_async()), 1/3

 src/gnome-cmd-user-actions.cc |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index eccb34f..87fe44b 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -1081,7 +1081,14 @@ void command_execute (GtkMenuItem *menuitem, gpointer command)
 
     DEBUG ('g', "running: %s\n", cmd.c_str());
 
-    gnome_execute_shell (dir && gnome_cmd_dir_is_local (dir) ? dir_path.c_str() : NULL, cmd.c_str());
+    gint argc;
+    gchar **argv;
+    GError *error = NULL;
+
+    g_shell_parse_argv (cmd.c_str(), &argc, &argv, NULL);
+    if (!g_spawn_async (gnome_cmd_dir_is_local (dir) ? dir_path.c_str() : NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error))
+        gnome_cmd_error_message (_("Unable to execute command."), error);
+    g_strfreev (argv);
 
     g_list_free (sfl);
 }



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