FileChooser portal: Handle 'current_filter'

Authored by michaelweghorn on Jun 2 2020, 6:41 PM.

Description

FileChooser portal: Handle 'current_filter'

From FileChooser portal documentation [1]:

current_filter (sa(us))

Request that this filter be set by default at dialog creation. If
the filters list is nonempty, it should match a filter in the list
to set the default filter from the list. Alternatively, it may be
specified when the list is empty to apply the filter
unconditionally.

The implemented approach adds the filter specified by current_filter
regardless of whether the passed filters list is empty or not.

Since KFileWidget always seems to select the first filter in the
list it was passed and there seems to be no way to explicitly select
a different one, this makes sure the the filter specified by
'current_filter' is the first one in the corresponding list.

[1] https://flatpak.github.io/xdg-desktop-portal/portal-docs.html#gdbus-org.freedesktop.impl.portal.FileChooser

Details

Committed
jgrulichJun 2 2020, 7:01 PM
Parents
R838:cf1c33a98d1c: SVN_SILENT made messages (.desktop file) - always resolve ours
Branches
Unknown
Tags
Unknown