From af0f13b46053254c7b2416a1f71a95d141247600 Mon Sep 17 00:00:00 2001 From: Doris Verria Date: Thu, 15 Dec 2022 21:44:10 +0100 Subject: [PATCH] iOS File Dialog: Allow picking files if name filter is '*' (all files) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Name filters may be not empty and include all files ('*'). We should not add any file type limitations in this case. Ammends commit ce20b81070c8283a7895e46dd79d560fb0b81462 Pick-to: 6.5 Change-Id: I3983e576a0ada4b7b40837c5c797359114b1ae02 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiosdocumentpickercontroller.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/ios/qiosdocumentpickercontroller.mm b/src/plugins/platforms/ios/qiosdocumentpickercontroller.mm index 350c965e87..af866077cd 100644 --- a/src/plugins/platforms/ios/qiosdocumentpickercontroller.mm +++ b/src/plugins/platforms/ios/qiosdocumentpickercontroller.mm @@ -23,7 +23,9 @@ results.append(QPlatformFileDialogHelper::cleanFilterList(filter)); docTypes = [self computeAllowedFileTypes:results]; - } else { + } + + if (!docTypes.count) { switch (fileDialog->options()->fileMode()) { case QFileDialogOptions::AnyFile: case QFileDialogOptions::ExistingFile: @@ -90,6 +92,9 @@ { QStringList fileTypes; for (const QString &filter : filters) { + if (filter == (QLatin1String("*"))) + continue; + if (filter.contains(u'?')) continue;