Skip to content

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

Merge request reports