FileChooser portal: Make sure filter.name is not empty

Xdg-desktop-portal will reject any OpenFile request if there is an empty
filter, so if we can't find the mimetype in the mimedatabase we just
use it's "raw name"

Pick-to: 6.6 6.5 5.15
Change-Id: I705ae7523445e5c2ec97a42ee334401bc90adb68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Albert Astals Cid 2023-09-25 23:49:23 +02:00
parent 00c1c04bd5
commit 88c74240a8

View File

@ -213,6 +213,9 @@ void QXdgDesktopPortalFileDialog::openPortal(Qt::WindowFlags windowFlags, Qt::Wi
filter.name = mimeType.comment();
filter.filterConditions = filterConditions;
if (filter.name.isEmpty())
filter.name = mimeTypefilter;
filterList << filter;
if (!d->selectedMimeTypeFilter.isEmpty() && d->selectedMimeTypeFilter == mimeTypefilter)