[gnome-commander/gcmd-1-2-8] Fixed problem #540438 (no GUI message if meld cannot be executed)



commit 5a3622f43ae3903e33ea623be9dc03854ee821f0
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Thu Jun 3 18:49:47 2010 +0200

    Fixed problem #540438 (no GUI message if meld cannot be executed)

 NEWS                           |    2 +-
 doc/C/gnome-commander.xml      |    2 +-
 src/gnome-cmd-file-selector.cc |    2 +-
 src/gnome-cmd-file.cc          |    2 +-
 src/gnome-cmd-user-actions.cc  |    4 ++--
 src/utils.cc                   |    4 ++--
 src/utils.h                    |   14 +++++++++-----
 7 files changed, 17 insertions(+), 13 deletions(-)
---
diff --git a/NEWS b/NEWS
index dfd79af..ad5bc97 100644
--- a/NEWS
+++ b/NEWS
@@ -3,7 +3,7 @@ gnome-commander 1.2.8.7
 ---------------
 
 Bug fixes:
- * Fixed problem ...
+ * Fixed problem #540438 (no GUI message if meld cannot be executed)
 
 
 ===================================
diff --git a/doc/C/gnome-commander.xml b/doc/C/gnome-commander.xml
index bf05d2e..ccb97b5 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -6043,7 +6043,7 @@
                 <para>
                     <itemizedlist>
                         <listitem>
-                            <para>...</para>
+                            <para>Fixed problem #540438 (no GUI message if meld cannot be executed)</para>
                         </listitem>
                     </itemizedlist>
                 </para>
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index 9ec1944..cb37b0e 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -1698,7 +1698,7 @@ static gboolean on_new_textfile_ok (GnomeCmdStringDialog *string_dialog, const g
     g_free (escaped_filepath);
 
     if (cmd)
-        run_command (cmd, FALSE);
+        run_command (cmd);
 
     return TRUE;
 }
diff --git a/src/gnome-cmd-file.cc b/src/gnome-cmd-file.cc
index f77c4f2..ff1beaa 100644
--- a/src/gnome-cmd-file.cc
+++ b/src/gnome-cmd-file.cc
@@ -755,7 +755,7 @@ inline void do_view_file (GnomeCmdFile *f, gint internal_viewer=-1)
         case FALSE: {
                         gchar *filename = gnome_cmd_file_get_quoted_real_path (f);
                         gchar *command = g_strdup_printf (gnome_cmd_data.get_viewer(), filename);
-                        run_command (command, FALSE);
+                        run_command (command);
                         g_free (filename);
                     }
                     break;
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index 80b94e3..5c497d0 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -822,7 +822,7 @@ void file_diff (GtkMenuItem *menuitem, gpointer not_used)
         gchar *cmd = g_strdup_printf (gnome_cmd_data.get_differ(), s.c_str(), "");
 
         g_print (_("running `%s'\n"), cmd);
-        run_command (cmd, FALSE);
+        run_command (cmd);
 
         g_free (cmd);
     }
@@ -848,7 +848,7 @@ void file_sync_dirs (GtkMenuItem *menuitem, gpointer not_used)
     gchar *cmd = g_strdup_printf (gnome_cmd_data.get_differ(), s.c_str(), "");
 
     g_print (_("running `%s'\n"), cmd);
-    run_command (cmd, FALSE);
+    run_command (cmd);
 
     g_free (cmd);
 }
diff --git a/src/utils.cc b/src/utils.cc
index d00b956..27f264e 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -640,7 +640,7 @@ static void do_mime_exec_multiple (gpointer *args)
         if (dirs.size()==1)
             run_command_indir (cmd.c_str(), dirs.begin()->c_str(), gnome_cmd_app_get_requires_terminal (app));
         else
-            run_command (cmd.c_str(), gnome_cmd_app_get_requires_terminal (app));
+            run_command_indir (cmd.c_str(), NULL, gnome_cmd_app_get_requires_terminal (app));
 
         g_list_free (files);
     }
@@ -1270,7 +1270,7 @@ void edit_mimetypes (const gchar *mime_type, gboolean blocking)
     if (blocking)
         system (cmd);
     else
-        run_command (cmd, FALSE);
+        run_command (cmd);
     g_free (cmd);
 }
 
diff --git a/src/utils.h b/src/utils.h
index 3f9005e..3aa6986 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -39,11 +39,18 @@ gboolean DEBUG_ENABLED (gchar flag);
 void DEBUG (gchar flag, const gchar *fmt, ...);
 void warn_print (const gchar *fmt, ...);
 
+void gnome_cmd_error_message (const gchar *title, GError *error);
+
 void run_command_indir (const gchar *command, const gchar *dir, gboolean term);
 
-inline void run_command (const gchar *command, gboolean term)
+inline void run_command (const gchar *command)
 {
-    run_command_indir (command, NULL, term);
+   GError *error = NULL;
+
+   DEBUG ('g', "running: %s\n", command);
+
+   if (!g_spawn_command_line_async (command, &error))
+       gnome_cmd_error_message (command, error);
 }
 
 const char **convert_varargs_to_name_array (va_list args);
@@ -248,9 +255,6 @@ inline void gnome_cmd_show_message (GtkWindow *parent, std::string message, cons
 }
 
 
-void gnome_cmd_error_message (const gchar *title, GError *error);
-
-
 inline void gnome_cmd_help_display (const gchar *file_name, const gchar *link_id=NULL)
 {
     GError *error = NULL;



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