mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
filechooserportal: Reverse file list
To avoid O(n²) behaviour, GtkFileChooserNativePortal uses the classic prepend tatict. However, it does not reverse the file list after building it. It's not a big deal since the portal does not specify the order in which the files are sent. But it's nice nonetheless to send the file list in the order in which files were passed originally. Reversing the list has no meaningful performance impact. Patch originally made by Bastien Nocera. See https://github.com/flatpak/xdg-desktop-portal/issues/548
This commit is contained in:
parent
c274d073e0
commit
62fedf4eed
@ -177,6 +177,7 @@ response_cb (GDBusConnection *connection,
|
||||
self->custom_files = NULL;
|
||||
for (i = 0; uris[i]; i++)
|
||||
self->custom_files = g_slist_prepend (self->custom_files, g_file_new_for_uri (uris[i]));
|
||||
self->custom_files = g_slist_reverse (self->custom_files);
|
||||
|
||||
g_free (uris);
|
||||
g_variant_unref (response_data);
|
||||
|
Loading…
Reference in New Issue
Block a user