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 <orgads@gmail.com>
This commit is contained in:
Christian Kandeler
2018-10-23 17:13:45 +02:00
parent 3592106cc5
commit effc565006

View File

@@ -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)