gvfs r2142 - in trunk: . daemon



Author: ryanl
Date: Tue Dec 16 09:20:00 2008
New Revision: 2142
URL: http://svn.gnome.org/viewvc/gvfs?rev=2142&view=rev

Log:
2008-12-16  Ryan Lortie  <desrt desrt ca>

        * daemon/gvfsbackendtrash.c (trash_backend_add_info): add 
        trash::orig-path and trash::deletion-date info



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

Modified: trunk/daemon/gvfsbackendtrash.c
==============================================================================
--- trunk/daemon/gvfsbackendtrash.c	(original)
+++ trunk/daemon/gvfsbackendtrash.c	Tue Dec 16 09:20:00 2008
@@ -454,21 +454,36 @@
                         GFileInfo *info,
                         gboolean   is_toplevel)
 {
-  GFile *original;
-
-  if (is_toplevel && item)
+  if (is_toplevel)
     {
+      const gchar *delete_date;
+      GFile *original;
+
+      g_assert (item != NULL);
+
       original = trash_item_get_original (item);
 
       if (original)
         {
-          gchar *basename;
+          gchar *basename, *path;
+
+          path = g_file_get_path (original);
+          basename = g_filename_display_basename (path);
 
-          basename = g_file_get_basename (original);
-          /* XXX: utf8ify or something... */
           g_file_info_set_display_name (info, basename);
+          g_file_info_set_attribute_byte_string (info,
+                                                 "trash::orig-path",
+                                                 path);
           g_free (basename);
+          g_free (path);
         }
+
+      delete_date = trash_item_get_delete_date (item);
+
+      if (delete_date)
+        g_file_info_set_attribute_string (info,
+                                          "trash::deletion-date",
+                                          delete_date);
     }
 
   g_file_info_set_attribute_boolean (info,



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