diff options
author | Tobias Hunger <tobias.hunger@digia.com> | 2014-07-30 16:37:41 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@digia.com> | 2014-07-30 16:45:00 +0200 |
commit | f130c3c7e5543f8240f16afe17a9a15d94a9c1da (patch) | |
tree | 3b61f093edb18ad2a5f2176521b41563b0ed1336 /src/plugins/coreplugin/featureprovider.h | |
parent | 6a52868cddb30e25788de317575f6d4dd29f8f9d (diff) | |
download | qt-creator-f130c3c7e5543f8240f16afe17a9a15d94a9c1da.tar.gz |
FeatureSet: Add some helper methods
I used to reimplement these a couple of times already.
Change-Id: I265cf50bf976638b4ac5406ae4010cf33c20354c
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/coreplugin/featureprovider.h')
-rw-r--r-- | src/plugins/coreplugin/featureprovider.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/coreplugin/featureprovider.h b/src/plugins/coreplugin/featureprovider.h index 9114cb1a45..27291579b4 100644 --- a/src/plugins/coreplugin/featureprovider.h +++ b/src/plugins/coreplugin/featureprovider.h @@ -77,6 +77,11 @@ public: return *this; } + bool isEmpty() const + { + return QSet<Feature>::isEmpty(); + } + bool contains(const Feature &feature) const { return QSet<Feature>::contains(feature); @@ -92,6 +97,11 @@ public: QSet<Feature>::remove(feature); } + void remove(const FeatureSet &features) + { + QSet<Feature>::subtract(features); + } + FeatureSet operator|(const Feature &feature) const { FeatureSet copy = *this; @@ -129,6 +139,14 @@ public: stringList.append(feature.toString()); return stringList; } + + static FeatureSet fromStringList(const QStringList &list) + { + FeatureSet features; + foreach (const QString &i, list) + features |= Feature(Id::fromString(i)); + return features; + } }; } // namespace Core |