[Xfce4-commits] [xfce/thunar] 01/01: Fix unescaping of local paths in path entry (bug #8190)

noreply at xfce.org noreply at xfce.org
Sun May 3 18:33:53 CEST 2015


This is an automated email from the git hooks/post-receive script.

hjudt pushed a commit to branch master
in repository xfce/thunar.

commit bfa875b6a76f812d638f2e88ea27a2cf95e5be1f
Author: Harald Judt <h.judt at gmx.at>
Date:   Sun May 3 18:31:14 2015 +0200

    Fix unescaping of local paths in path entry (bug #8190)
    
    Unfortunately, the previous commit did not work correctly for local paths
    in all cases. This commit fixes this by distinguishing between local paths
    and URIs.
---
 thunar/thunar-path-entry.c |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/thunar/thunar-path-entry.c b/thunar/thunar-path-entry.c
index 6b2ac95..6ce77f3 100644
--- a/thunar/thunar-path-entry.c
+++ b/thunar/thunar-path-entry.c
@@ -1154,10 +1154,11 @@ void
 thunar_path_entry_set_current_file (ThunarPathEntry *path_entry,
                                     ThunarFile      *current_file)
 {
-  GFile *file;
-  gchar *text;
-  gchar *unescaped;
-  gchar *tmp;
+  GFile    *file;
+  gchar    *text;
+  gchar    *unescaped;
+  gchar    *tmp;
+  gboolean  is_uri = FALSE;
 
   _thunar_return_if_fail (THUNAR_IS_PATH_ENTRY (path_entry));
   _thunar_return_if_fail (current_file == NULL || THUNAR_IS_FILE (current_file));
@@ -1178,12 +1179,16 @@ thunar_path_entry_set_current_file (ThunarPathEntry *path_entry,
 
           /* if there is no local path, use the URI (which always works) */
           if (text == NULL)
-            text = g_file_get_uri (file);
+            {
+              text = g_file_get_uri (file);
+              is_uri = TRUE;
+            }
         }
       else
         {
           /* not a native file, use the URI */
           text = g_file_get_uri (file);
+          is_uri = TRUE;
         }
 
       /* if the file is a directory, end with a / to avoid loading the parent
@@ -1197,8 +1202,9 @@ thunar_path_entry_set_current_file (ThunarPathEntry *path_entry,
         }
     }
 
-  unescaped = g_uri_unescape_string (text, NULL);
-  if (unescaped == NULL)
+  if (is_uri)
+    unescaped = g_uri_unescape_string (text, NULL);
+  else
     unescaped = g_strdup (text);
   g_free (text);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list