gnome-commander r1547 - in branches/gcmd-1-3: . src



Author: epiotr
Date: Fri Jan 25 23:27:06 2008
New Revision: 1547
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1547&view=rev

Log:
Do not use escaped directory name when runnning editor application

Modified:
   branches/gcmd-1-3/ChangeLog
   branches/gcmd-1-3/src/gnome-cmd-file.cc
   branches/gcmd-1-3/src/gnome-cmd-file.h

Modified: branches/gcmd-1-3/src/gnome-cmd-file.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-file.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-file.cc	Fri Jan 25 23:27:06 2008
@@ -370,6 +370,18 @@
 }
 
 
+gchar *gnome_cmd_file_get_unescaped_dirname (GnomeCmdFile *finfo)
+{
+    GnomeVFSURI *uri = gnome_cmd_file_get_uri (finfo);
+    gchar *path = gnome_vfs_uri_extract_dirname (uri);
+    gnome_vfs_uri_unref (uri);
+    gchar *unescaped_path = gnome_vfs_unescape_string (path, NULL);
+    g_free (path);
+
+    return unescaped_path;
+}
+
+
 GnomeVFSURI *gnome_cmd_file_get_uri (GnomeCmdFile *finfo)
 {
     g_return_val_if_fail (GNOME_CMD_IS_FILE (finfo), NULL);
@@ -745,7 +757,7 @@
         return;
 
     gchar *fpath = gnome_cmd_file_get_quoted_real_path (finfo);
-    gchar *dpath = gnome_cmd_file_get_dirname (finfo);
+    gchar *dpath = gnome_cmd_file_get_unescaped_dirname (finfo);
     gchar *command = g_strdup_printf (gnome_cmd_data_get_editor (), fpath);
 
     run_command_indir (command, dpath, FALSE);

Modified: branches/gcmd-1-3/src/gnome-cmd-file.h
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-file.h	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-file.h	Fri Jan 25 23:27:06 2008
@@ -78,6 +78,7 @@
 gchar *gnome_cmd_file_get_real_path (GnomeCmdFile *finfo);
 gchar *gnome_cmd_file_get_quoted_real_path (GnomeCmdFile *finfo);
 gchar *gnome_cmd_file_get_dirname (GnomeCmdFile *finfo);
+gchar *gnome_cmd_file_get_unescaped_dirname (GnomeCmdFile *finfo);
 GnomeVFSURI *gnome_cmd_file_get_uri (GnomeCmdFile *finfo);
 gchar *gnome_cmd_file_get_uri_str (GnomeCmdFile *finfo);
 



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