directorylist: Always add standard::name

glib can't figure out how to do that, so we need to do that ourselves.
This commit is contained in:
Benjamin Otte 2022-10-17 20:33:15 +02:00 committed by Matthias Clasen
parent fce4810fb4
commit 8a7f739f9f

View File

@ -544,6 +544,7 @@ static void
gtk_directory_list_start_loading (GtkDirectoryList *self) gtk_directory_list_start_loading (GtkDirectoryList *self)
{ {
gboolean was_loading; gboolean was_loading;
char *glib_apis_suck;
was_loading = gtk_directory_list_stop_loading (self); was_loading = gtk_directory_list_stop_loading (self);
gtk_directory_list_clear_items (self); gtk_directory_list_clear_items (self);
@ -555,14 +556,16 @@ gtk_directory_list_start_loading (GtkDirectoryList *self)
return; return;
} }
glib_apis_suck = g_strconcat ("standard::name,", self->attributes, NULL);
self->cancellable = g_cancellable_new (); self->cancellable = g_cancellable_new ();
g_file_enumerate_children_async (self->file, g_file_enumerate_children_async (self->file,
self->attributes, glib_apis_suck,
G_FILE_QUERY_INFO_NONE, G_FILE_QUERY_INFO_NONE,
self->io_priority, self->io_priority,
self->cancellable, self->cancellable,
gtk_directory_list_got_enumerator_cb, gtk_directory_list_got_enumerator_cb,
self); self);
g_free (glib_apis_suck);
if (!was_loading) if (!was_loading)
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_LOADING]); g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_LOADING]);
@ -861,8 +864,8 @@ gtk_directory_list_get_file (GtkDirectoryList *self)
* *
* Sets the @attributes to be enumerated and starts the enumeration. * Sets the @attributes to be enumerated and starts the enumeration.
* *
* If @attributes is %NULL, no attributes will be queried, but a list * If @attributes is %NULL, the list of file infos will still be created, it will just
* of `GFileInfo`s will still be created. * not contain any extra attributes.
*/ */
void void
gtk_directory_list_set_attributes (GtkDirectoryList *self, gtk_directory_list_set_attributes (GtkDirectoryList *self,