FileUtils: Adds toFilePathList function

Change-Id: Ie3137751135fdb6c3161cc886f307323fcce6b72
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Marcus Tillmanns
2022-08-02 09:27:21 +02:00
parent 2d79bff3c1
commit 04205d1225
18 changed files with 45 additions and 32 deletions

View File

@@ -556,7 +556,7 @@ FilePaths FileUtils::getOpenFilePaths(QWidget *parent,
filter,
selectedFilter,
options);
return transform(result, &FilePath::fromString);
return FileUtils::toFilePathList(result);
}
FilePath FileUtils::getOpenFilePathFromDevice(QWidget *parent,
@@ -812,4 +812,9 @@ FilePath FileUtils::homePath()
return FilePath::fromString(doCleanPath(QDir::homePath()));
}
FilePaths FileUtils::toFilePathList(const QStringList &paths) {
return transform(paths, [](const QString &path) { return FilePath::fromString(path); });
}
} // namespace Utils