MainWindow: Use FileUtils::get... functions

Changes the MainWindow to use FileUtils::getFilePaths function
to access files on devices instead of QFileDialog.

Change-Id: I0981c960b643edd69510cfed1cce16346962d75a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Marcus Tillmanns
2022-10-12 14:09:37 +02:00
parent da0cb254b2
commit 35de9566b6
5 changed files with 11 additions and 37 deletions

View File

@@ -1032,11 +1032,12 @@ void DocumentManager::showFilePropertiesDialog(const FilePath &filePath)
FilePaths DocumentManager::getOpenFileNames(const QString &filters,
const FilePath &pathIn,
QString *selectedFilter)
QString *selectedFilter,
QFileDialog::Options options)
{
const FilePath path = pathIn.isEmpty() ? fileDialogInitialDirectory() : pathIn;
const FilePaths files = FileUtils::getOpenFilePaths(nullptr, tr("Open File"), path, filters,
selectedFilter);
selectedFilter, options);
if (!files.isEmpty())
setFileDialogLastVisitedDirectory(files.front().absolutePath());
return files;