Unarchiver: Replace QVector with QList

Change-Id: Ib8a954f1b29ee475b645191424eb0e391dbb6baf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2023-07-13 17:50:21 +02:00
parent 6bb8bbabd2
commit 9f3e0db3e4

View File

@@ -37,9 +37,9 @@ static FilePaths additionalInstallDirs(const QString &registryKey, const QString
#endif
}
static const QVector<Tool> &sTools()
static const QList<Tool> &sTools()
{
static QVector<Tool> tools;
static QList<Tool> tools;
if (tools.isEmpty()) {
if (HostOsInfo::isWindowsHost()) {
tools << Tool{{"powershell", "-command Expand-Archive -Force '%{src}' '%{dest}'", CommandLine::Raw},
@@ -76,7 +76,7 @@ static const QVector<Tool> &sTools()
return tools;
}
static QVector<Tool> toolsForMimeType(const MimeType &mimeType)
static QList<Tool> toolsForMimeType(const MimeType &mimeType)
{
return Utils::filtered(sTools(), [mimeType](const Tool &tool) {
return Utils::anyOf(tool.supportedMimeTypes,
@@ -84,7 +84,7 @@ static QVector<Tool> toolsForMimeType(const MimeType &mimeType)
});
}
static QVector<Tool> toolsForFilePath(const FilePath &fp)
static QList<Tool> toolsForFilePath(const FilePath &fp)
{
return toolsForMimeType(mimeTypeForFile(fp));
}
@@ -100,7 +100,7 @@ static std::optional<Tool> resolveTool(const Tool &tool)
expected_str<Unarchiver::SourceAndCommand> Unarchiver::sourceAndCommand(const FilePath &sourceFile)
{
const QVector<Tool> tools = toolsForFilePath(sourceFile);
const QList<Tool> tools = toolsForFilePath(sourceFile);
if (tools.isEmpty())
return make_unexpected(Tr::tr("File format not supported."));