src: Migrate QProcess::start() to QStringList (#1107)

The non-QStringList variant of QProcess::start() was removed in Qt 5.15.
The adapted method handles escaping of the arguments, which simplifies
code in some locations.
This commit is contained in:
Frédéric Simonis
2020-11-18 15:45:38 +01:00
committed by GitHub
parent 4277bcc47d
commit 8b8c186697
2 changed files with 21 additions and 20 deletions
+4 -4
View File
@@ -188,16 +188,16 @@ void TaskBuildIndex::runIndexerProcess(int processId, const std::wstring& logFil
return;
}
const std::wstring commandPath = L"\"" + indexerProcessPath.wstr() + L"\"";
const std::wstring commandPath = indexerProcessPath.wstr();
std::vector<std::wstring> commandArguments;
commandArguments.push_back(std::to_wstring(processId));
commandArguments.push_back(utility::decodeFromUtf8(m_appUUID));
commandArguments.push_back(L"\"" + AppPath::getSharedDataPath().getAbsolute().wstr() + L"\"");
commandArguments.push_back(L"\"" + UserPaths::getUserDataPath().getAbsolute().wstr() + L"\"");
commandArguments.push_back(AppPath::getSharedDataPath().getAbsolute().wstr());
commandArguments.push_back(UserPaths::getUserDataPath().getAbsolute().wstr());
if (!logFilePath.empty())
{
commandArguments.push_back(L"\"" + logFilePath + L"\"");
commandArguments.push_back(logFilePath);
}
int result = 1;