localfileenumerator: Improve non-stat'ing code
authorBenjamin Otte <otte@redhat.com>
Tue, 1 Nov 2011 23:31:50 +0000 (00:31 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 16 Nov 2011 16:22:17 +0000 (17:22 +0100)
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

index f24db15..5cba475 100644 (file)
@@ -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);