diff --git a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp index ef93c2a4b0b..96527ad3007 100644 --- a/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp +++ b/src/plugins/qbsprojectmanager/qbsprofilemanager.cpp @@ -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()) diff --git a/src/plugins/qbsprojectmanager/qbsprofilemanager.h b/src/plugins/qbsprojectmanager/qbsprofilemanager.h index 9e4b9600dcc..745802da8de 100644 --- a/src/plugins/qbsprojectmanager/qbsprofilemanager.h +++ b/src/plugins/qbsprojectmanager/qbsprofilemanager.h @@ -52,7 +52,8 @@ public: static QString ensureProfileForKit(const ProjectExplorer::Kit *k); static QString profileNameForKit(const ProjectExplorer::Kit *kit); static void updateProfileIfNecessary(const ProjectExplorer::Kit *kit); - enum class QbsConfigOp { Get, Set, Unset }; static QString runQbsConfig(QbsConfigOp op, const QString &key, const QVariant &value = {}); + enum class QbsConfigOp { Get, Set, Unset, AddProfile }; + static QString runQbsConfig(QbsConfigOp op, const QString &key, const QVariant &value = {}); signals: void qbsProfilesUpdated();