diff --git a/plugins/filetemplates/templateselectionpage.cpp b/plugins/filetemplates/templateselectionpage.cpp --- a/plugins/filetemplates/templateselectionpage.cpp +++ b/plugins/filetemplates/templateselectionpage.cpp @@ -145,10 +145,22 @@ void TemplateSelectionPagePrivate::loadFileClicked() { - QString filter = "application/x-desktop application/x-bzip-compressed-tar application/zip"; - QString fileName = QFileDialog::getOpenFileName(page, QString(), QString(), filter); - - if (!fileName.isEmpty()) + const QStringList filters{ + QStringLiteral("application/x-desktop"), + QStringLiteral("application/x-bzip-compressed-tar"), + QStringLiteral("application/zip") + }; + QFileDialog dlg(page); + dlg.setNameFilter(QStringLiteral("*.*")); + dlg.setMimeTypeFilters(filters); + dlg.setFileMode(QFileDialog::ExistingFiles); + + if (!dlg.exec()) + { + return; + } + + foreach(const QString& fileName, dlg.selectedFiles()) { QString destination = model->loadTemplateFile(fileName); QModelIndexList indexes = model->templateIndexes(destination);