diff options
-rw-r--r-- | src/core/file_picker_controller.cpp | 3 | ||||
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_filePicker.qml | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp index 13e9437d2..62e02e126 100644 --- a/src/core/file_picker_controller.cpp +++ b/src/core/file_picker_controller.cpp @@ -172,6 +172,9 @@ QStringList FilePickerController::nameFilters(const QStringList &acceptedMimeTyp QStringList acceptedGlobs; QMimeDatabase mimeDatabase; + if (acceptedMimeTypes.isEmpty()) + return nameFilters; + for (QString type : acceptedMimeTypes) { if (type.startsWith(".")) { // A single suffix diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml index c9572224e..15eadb2a1 100644 --- a/tests/auto/quick/qmltests/data/tst_filePicker.qml +++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml @@ -267,7 +267,7 @@ TestWebEngineView { { tag: "CustomSuffix", input: ".pug", expected: ".pug", exactMatch: false}, { tag: "CustomMime", input: "dog/pug", expected: "Accepted types ()", exactMatch: true}, { tag: "CustomGlob", input: "dog/*", expected: "Accepted types ()", exactMatch: true}, - { tag: "Invalid", input: "---", expected: "Accepted types ()", exactMatch: true}, + { tag: "Invalid", input: "---", expected: undefined, exactMatch: true}, { tag: "Jpeg", input: "image/jpeg", expected: ".jpeg", exactMatch: false} ]; } |