forked from qt-creator/qt-creator
FeatureProvider: Move features into Kits
Make available features and platforms methods on kits (implemented via the KitInformation). Add convenience methods to KitManager to collect all that. Remove QtFeatureProvider and implement KitFeatureProvider instead. The idea of this patch is to make it easier to find which kits are applicable to which wizard: I should now be able to match the wizard features against a kit and have a good set of kits to choose from. Change-Id: Ie5be0213f142cfdf4417ac55bd6cbb056265a531 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
@@ -582,6 +582,45 @@ bool Kit::isMutable(Id id) const
|
||||
return d->m_mutable.contains(id);
|
||||
}
|
||||
|
||||
QSet<QString> Kit::availablePlatforms() const
|
||||
{
|
||||
QSet<QString> platforms;
|
||||
foreach (const KitInformation *ki, KitManager::kitInformation())
|
||||
platforms.unite(ki->availablePlatforms(this));
|
||||
return platforms;
|
||||
}
|
||||
|
||||
bool Kit::hasPlatform(const QString &platform) const
|
||||
{
|
||||
if (platform.isEmpty())
|
||||
return true;
|
||||
return availablePlatforms().contains(platform);
|
||||
}
|
||||
|
||||
QString Kit::displayNameForPlatform(const QString &platform) const
|
||||
{
|
||||
foreach (const KitInformation *ki, KitManager::kitInformation()) {
|
||||
const QString displayName = ki->displayNameForPlatform(this, platform);
|
||||
if (!displayName.isEmpty())
|
||||
return displayName;
|
||||
}
|
||||
return QString();
|
||||
|
||||
}
|
||||
|
||||
FeatureSet Kit::availableFeatures() const
|
||||
{
|
||||
Core::FeatureSet features;
|
||||
foreach (const KitInformation *ki, KitManager::kitInformation())
|
||||
features |= ki->availableFeatures(this);
|
||||
return features;
|
||||
}
|
||||
|
||||
bool Kit::hasFeatures(const FeatureSet &features) const
|
||||
{
|
||||
return availableFeatures().contains(features);
|
||||
}
|
||||
|
||||
void Kit::kitUpdated()
|
||||
{
|
||||
if (d->m_nestedBlockingLevel > 0 && !d->m_mustNotifyAboutDisplayName) {
|
||||
|
||||
Reference in New Issue
Block a user