[glib/filechooserentry: 10/10] localfileenumerator: Improve non-stat'ing code



commit 08ae4fe0d083d13fb30480657c56b04feca7a327
Author: Benjamin Otte <otte redhat com>
Date:   Wed Nov 2 00:31:50 2011 +0100

    localfileenumerator: Improve non-stat'ing code
    
    We now avoid the per-enumerated-file stat for type and names. We could
    improve this further by moving things to the no_stat function, but this
    is what the file chooser needs for autocomplete, so I am happy.

 gio/glocalfileenumerator.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gio/glocalfileenumerator.c b/gio/glocalfileenumerator.c
index f24db15..5cba475 100644
--- a/gio/glocalfileenumerator.c
+++ b/gio/glocalfileenumerator.c
@@ -254,7 +254,8 @@ _g_local_file_enumerator_new (GLocalFile *file,
   local->matcher = g_file_attribute_matcher_new (attributes);
 #ifndef USE_GDIR
   local->reduced_matcher = g_file_attribute_matcher_subtract_attributes (local->matcher,
-                                                                         "standard::type,standard::name");
+                                                                         G_LOCAL_FILE_INFO_NOSTAT_ATTRIBUTES","
+                                                                         "standard::type");
 #endif
   local->flags = flags;
   
@@ -408,7 +409,7 @@ g_local_file_enumerator_next_file (GFileEnumerator  *enumerator,
                                      &my_error); 
       if (info)
         {
-          g_file_info_set_name (info, filename);
+          _g_local_file_info_get_nostat (info, filename, path, local->matcher);
           g_file_info_set_file_type (info, file_type);
           if (file_type == G_FILE_TYPE_SYMBOLIC_LINK)
             g_file_info_set_is_symlink (info, TRUE);



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