QbsProjectManager: Allow users to override profile properties.

Creator derives its qbs profiles from the kits and overwrites
them as it sees fit, which means users cannot set custom properties
by editing the respective settings files or using the normal
qbs command-line tools. Therefore, we need to provide them with
a way to do this from Creator itself. For this purpose, we
introduce a settings page where a user can add or override
qbs properties per kit. The resulting "diff" is then applied
whenever the profiles are written, so qbs will take the
custom properties into account.

Change-Id: I909f5243c65647f62c91a2afa242fd531ddaf915
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Christian Kandeler
2014-10-31 14:51:55 +01:00
parent 5d8c0f9c88
commit bdb9a14de0
14 changed files with 752 additions and 6 deletions

View File

@@ -141,9 +141,22 @@ static QStringList toolchainList(const ProjectExplorer::ToolChain *tc)
return list;
}
QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, const QVariantMap &defaultData) const
QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k,
const QVariantMap &defaultData) const
{
QTC_ASSERT(k, return defaultData);
QVariantMap data = autoGeneratedProperties(k, defaultData);
const QVariantMap customProperties = k->value(Core::Id(QBS_PROPERTIES_KEY_FOR_KITS)).toMap();
for (QVariantMap::ConstIterator it = customProperties.constBegin();
it != customProperties.constEnd(); ++it) {
data.insert(it.key(), it.value());
}
return data;
}
QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplorer::Kit *k,
const QVariantMap &defaultData) const
{
QVariantMap data = defaultData;
const QString sysroot = ProjectExplorer::SysRootKitInformation::sysRoot(k).toUserOutput();