From ee6f73048d25aa672ab35f015d7c717d9ce12991 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 6 Mar 2025 14:28:34 +0100 Subject: [PATCH] QmakeProjectManager: Remove one use of ProcessArgs::ConstArgIterator The code is effectively only called from the CocoPlugin and was originally copied from QMakeStep::parserArgument() where it is used to hide potentially syntactically wrong/unexpanded items from the (anyway imprecise) internal .pro parser. Using the expanded value is simpler and has about the same level of incorrectness in a get/set roundtrip: Previously e.g. arguments provided by macros were entirely dropped, now they can get replaced by a fixed expansion. Both cases only affect complex setups of the qmake step's "Additional arguments" case. Change-Id: I9307371b5ca88415b0424077ceeaa4dc80f86afe Reviewed-by: Christian Stenger --- .../qmakeprojectmanager/qmakebuildconfiguration.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 2ba0fc591e8..9766949d7a2 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -418,16 +418,8 @@ QStringList QmakeBuildConfiguration::initialArgs() const { if (BuildStepList *buildSteps = this->buildSteps()) { if (auto qmakeStep = buildSteps->firstOfType()) { - QString arg = qmakeStep->userArguments.unexpandedArguments(); - ProcessArgs::ConstArgIterator it{arg}; - QStringList result; - - while (it.next()) { - if (it.isSimple()) - result << it.value(); - } - - return result; + return ProcessArgs::splitArgs(qmakeStep->userArguments.arguments(), + project()->projectFilePath().osType()); } } return {};