forked from qt-creator/qt-creator
Utils: Fix template arguments replacement for unarchiver
This makes sure that paths containing spaces will not cause issues. Fixes: QTCREATORBUG-32308 Change-Id: Idf044c5e48058c620ec0a4b4154a07d088790b9c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -127,10 +127,10 @@ expected_str<Unarchiver::SourceAndCommand> Unarchiver::sourceAndCommand(const Fi
|
|||||||
static CommandLine unarchiveCommand(const CommandLine &commandTemplate, const FilePath &sourceFile,
|
static CommandLine unarchiveCommand(const CommandLine &commandTemplate, const FilePath &sourceFile,
|
||||||
const FilePath &destDir)
|
const FilePath &destDir)
|
||||||
{
|
{
|
||||||
CommandLine command = commandTemplate;
|
const QStringList args = Utils::transform(commandTemplate.splitArguments(), [&](auto arg) {
|
||||||
command.setArguments(command.arguments().replace("%{src}", sourceFile.path())
|
return arg.replace("%{src}", sourceFile.path()).replace("%{dest}", destDir.path());
|
||||||
.replace("%{dest}", destDir.path()));
|
});
|
||||||
return command;
|
return CommandLine(commandTemplate.executable(), args);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unarchiver::start()
|
void Unarchiver::start()
|
||||||
|
Reference in New Issue
Block a user