PE: Do not clear run cmdline arguments for CMake targets

Amends 5537a102e6

Only set the command line arguments if the "arguments" additional data
is present.

Fixes: QTCREATORBUG-32454
Change-Id: I5b3d5607218d97b184bd361b02b650e2d9863dc0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2025-02-13 15:40:18 +01:00
parent 2d0562d2aa
commit 30dca2a996

View File

@@ -144,11 +144,9 @@ void DesktopRunConfiguration::updateTargetInformation()
aspect<ExecutableAspect>()->setExecutable(bti.targetFilePath);
aspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(bti.workingDirectory);
auto argumentsAsString = [bti]() {
return CommandLine{"", bti.additionalData.toMap()["arguments"].toStringList()}
.arguments();
};
aspect<ArgumentsAspect>()->setArguments(argumentsAsString());
const QStringList argumentsList = bti.additionalData.toMap()["arguments"].toStringList();
if (!argumentsList.isEmpty())
aspect<ArgumentsAspect>()->setArguments(CommandLine{"", argumentsList}.arguments());
emit aspect<EnvironmentAspect>()->environmentChanged();
}