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.
This commit is contained in:
Benjamin Otte 2011-11-02 00:31:50 +01:00
parent 93aea49bd7
commit 3c66ada435

View 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);