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



commit efbf6fd82b646afef495a501ccc60f19378e1fe3
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 359c81c..002d127 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -1077,7 +1077,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]