gvfs r1224 - in trunk: . daemon



Author: alexl
Date: Mon Feb  4 11:06:28 2008
New Revision: 1224
URL: http://svn.gnome.org/viewvc/gvfs?rev=1224&view=rev

Log:
2008-02-04  Alexander Larsson  <alexl redhat com>

        * daemon/gvfsbackendsftp.c:
	Make name of sftp root be "/ on <host>" (#511515)




Modified:
   trunk/ChangeLog
   trunk/daemon/gvfsbackendsftp.c

Modified: trunk/daemon/gvfsbackendsftp.c
==============================================================================
--- trunk/daemon/gvfsbackendsftp.c	(original)
+++ trunk/daemon/gvfsbackendsftp.c	Mon Feb  4 11:06:28 2008
@@ -3008,9 +3008,20 @@
   else
     {
       data->stat_info = g_file_info_new ();
-      basename = g_path_get_basename (G_VFS_JOB_QUERY_INFO (job)->filename);
+      basename = NULL;
+      if (strcmp (G_VFS_JOB_QUERY_INFO (job)->filename, "/") != 0)
+        basename = g_path_get_basename (G_VFS_JOB_QUERY_INFO (job)->filename);
       parse_attributes (backend, data->stat_info, basename,
                         reply, G_VFS_JOB_QUERY_INFO (job)->attribute_matcher);
+      if (basename == NULL)
+        {
+          char *name;
+
+          /* Translators: This is the name of the root of an sftp share, like "/ on <hostname>" */
+          name = g_strdup_printf (_("/ on %s"), G_VFS_BACKEND_SFTP (backend)->host);
+          g_file_info_set_display_name (data->stat_info, name);
+          g_free (name);
+        }
       g_free (basename);
     }
 
@@ -3039,9 +3050,20 @@
   else
     {
       data->lstat_info = g_file_info_new ();
-      basename = g_path_get_basename (G_VFS_JOB_QUERY_INFO (job)->filename);
+      basename = NULL;
+      if (strcmp (G_VFS_JOB_QUERY_INFO (job)->filename, "/") != 0)
+        basename = g_path_get_basename (G_VFS_JOB_QUERY_INFO (job)->filename);
       parse_attributes (backend, data->lstat_info, basename,
                         reply, G_VFS_JOB_QUERY_INFO (job)->attribute_matcher);
+      if (basename == NULL)
+        {
+          char *name;
+          
+          /* Translators: This is the name of the root of an sftp share, like "/ on <hostname>" */
+          name = g_strdup_printf (_("/ on %s"), G_VFS_BACKEND_SFTP (backend)->host);
+          g_file_info_set_display_name (data->lstat_info, name);
+          g_free (name);
+        }
       g_free (basename);
     }
 



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