[Xfce4-commits] r30032 - in thunar/branches/migration-to-gio: . thunar

Jannis Pohlmann jannis at xfce.org
Tue Jun 16 12:15:06 CEST 2009


Author: jannis
Date: 2009-06-16 10:15:06 +0000 (Tue, 16 Jun 2009)
New Revision: 30032

Modified:
   thunar/branches/migration-to-gio/ChangeLog
   thunar/branches/migration-to-gio/thunar/thunar-path-entry.c
Log:
	* thunar/thunar-path-entry.c: Display the local path only for native
	  files. If there is no path, use the URI. Always use the URI for
	  non-native files.

Modified: thunar/branches/migration-to-gio/ChangeLog
===================================================================
--- thunar/branches/migration-to-gio/ChangeLog	2009-06-16 00:00:40 UTC (rev 30031)
+++ thunar/branches/migration-to-gio/ChangeLog	2009-06-16 10:15:06 UTC (rev 30032)
@@ -1,5 +1,11 @@
 2009-06-16	Jannis Pohlmann <jannis at xfce.org>
 
+	* thunar/thunar-path-entry.c: Display the local path only for native
+	  files. If there is no path, use the URI. Always use the URI for
+	  non-native files.
+
+2009-06-16	Jannis Pohlmann <jannis at xfce.org>
+
 	* thunar/thunar-renamer-model.c: Remove the ThunarVfsInfo member of
 	  ThunarRenamerModelItem. Always invalidate and update the item/row
 	  when the ThunarFile changes (unless the model is frozen of course). 

Modified: thunar/branches/migration-to-gio/thunar/thunar-path-entry.c
===================================================================
--- thunar/branches/migration-to-gio/thunar/thunar-path-entry.c	2009-06-16 00:00:40 UTC (rev 30031)
+++ thunar/branches/migration-to-gio/thunar/thunar-path-entry.c	2009-06-16 10:15:06 UTC (rev 30032)
@@ -1413,10 +1413,21 @@
     }
   else
     {
-      /* try absolute path, fallback to URI if not a local file */
-      text = g_file_get_path (file);
-      if (text == NULL)
-        text = g_file_get_uri (file);
+      /* check if the file is native to the platform */
+      if (g_file_is_native (file))
+        {
+          /* it is, try the local path first */
+          text = g_file_get_path (file);
+
+          /* if there is no local path, use the URI (which always works) */
+          if (text == NULL)
+            text = g_file_get_uri (file);
+        }
+      else
+        {
+          /* not a native file, use the URI */
+          text = g_file_get_uri (file);
+        }
     }
 
   /* setup the entry text */




More information about the Xfce4-commits mailing list