forked from qt-creator/qt-creator
QbsProjectManager: Make use of qbs config --add-profile
... if available. Task-number: QTCREATORBUG-25463 Change-Id: I7fc8a06a5c43b35c4b1b571504d31cc03a95b189 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -183,9 +183,13 @@ void QbsProfileManager::addProfileFromKit(const ProjectExplorer::Kit *k)
|
||||
if (const QtSupport::BaseQtVersion * const qt = QtSupport::QtKitAspect::qtVersion(k))
|
||||
data.insert("moduleProviders.Qt.qmakeFilePaths", qt->qmakeCommand().toString());
|
||||
|
||||
const QString keyPrefix = "profiles." + name + ".";
|
||||
for (auto it = data.begin(); it != data.end(); ++it)
|
||||
runQbsConfig(QbsConfigOp::Set, keyPrefix + it.key(), it.value());
|
||||
if (QbsSettings::qbsVersion() < QVersionNumber({1, 20})) {
|
||||
const QString keyPrefix = "profiles." + name + ".";
|
||||
for (auto it = data.begin(); it != data.end(); ++it)
|
||||
runQbsConfig(QbsConfigOp::Set, keyPrefix + it.key(), it.value());
|
||||
} else {
|
||||
runQbsConfig(QbsConfigOp::AddProfile, name, data);
|
||||
}
|
||||
emit qbsProfilesUpdated();
|
||||
}
|
||||
|
||||
@@ -228,6 +232,13 @@ QString QbsProfileManager::runQbsConfig(QbsConfigOp op, const QString &key, cons
|
||||
case QbsConfigOp::Unset:
|
||||
args << "--unset" << key;
|
||||
break;
|
||||
case QbsConfigOp::AddProfile: {
|
||||
args << "--add-profile" << key;
|
||||
const QVariantMap props = value.toMap();
|
||||
for (auto it = props.begin(); it != props.end(); ++it)
|
||||
args << it.key() << toJSLiteral(it.value());
|
||||
break;
|
||||
}
|
||||
}
|
||||
const Utils::FilePath qbsExe = QbsSettings::qbsExecutableFilePath();
|
||||
if (qbsExe.isEmpty() || !qbsExe.exists())
|
||||
|
||||
Reference in New Issue
Block a user