From effc565006b1bed7fd6a5cb67f9147727e47033b Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 23 Oct 2018 17:13:45 +0200 Subject: [PATCH] QbsProjectManager: Prevent "special properties" in the line edit ... of the build step widget. By "special properties" we mean those for which a dedicated UI element exists. Fixes: QTCREATORBUG-21363 Change-Id: I8b136798340c1a2cdc178451247a9f1f77d91dd7 Reviewed-by: Orgad Shaneh --- src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 74eeb6a22cb..6020a89a48f 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -794,8 +794,19 @@ bool QbsBuildStepConfigWidget::validateProperties(Utils::FancyLineEdit *edit, QS foreach (const QString &rawArg, argList) { int pos = rawArg.indexOf(':'); if (pos > 0) { + const QString propertyName = rawArg.left(pos); + static const QStringList specialProperties{ + Constants::QBS_CONFIG_PROFILE_KEY, Constants::QBS_CONFIG_VARIANT_KEY, + Constants::QBS_CONFIG_QUICK_DEBUG_KEY, Constants::QBS_INSTALL_ROOT_KEY}; + if (specialProperties.contains(propertyName)) { + if (errorMessage) { + *errorMessage = tr("Property \"%1\" cannot be set here. " + "Please use the dedicated UI element.").arg(propertyName); + } + return false; + } const QString rawValue = rawArg.mid(pos + 1); - Property property(rawArg.left(pos), rawValue, expander->expand(rawValue)); + Property property(propertyName, rawValue, expander->expand(rawValue)); properties.append(property); } else { if (errorMessage)