From 30dca2a996f261e7e9814cd438fa055f155ef6e7 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Thu, 13 Feb 2025 15:40:18 +0100 Subject: [PATCH] PE: Do not clear run cmdline arguments for CMake targets Amends 5537a102e6df273afe63f9323410873831896c6d Only set the command line arguments if the "arguments" additional data is present. Fixes: QTCREATORBUG-32454 Change-Id: I5b3d5607218d97b184bd361b02b650e2d9863dc0 Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/desktoprunconfiguration.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plugins/projectexplorer/desktoprunconfiguration.cpp b/src/plugins/projectexplorer/desktoprunconfiguration.cpp index 83a6a87dbc6..30c3234bd17 100644 --- a/src/plugins/projectexplorer/desktoprunconfiguration.cpp +++ b/src/plugins/projectexplorer/desktoprunconfiguration.cpp @@ -144,11 +144,9 @@ void DesktopRunConfiguration::updateTargetInformation() aspect()->setExecutable(bti.targetFilePath); aspect()->setDefaultWorkingDirectory(bti.workingDirectory); - auto argumentsAsString = [bti]() { - return CommandLine{"", bti.additionalData.toMap()["arguments"].toStringList()} - .arguments(); - }; - aspect()->setArguments(argumentsAsString()); + const QStringList argumentsList = bti.additionalData.toMap()["arguments"].toStringList(); + if (!argumentsList.isEmpty()) + aspect()->setArguments(CommandLine{"", argumentsList}.arguments()); emit aspect()->environmentChanged(); }