aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/kitmanager.h
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2017-01-11 17:25:58 +0100
committerTobias Hunger <tobias.hunger@qt.io>2017-01-18 10:39:16 +0000
commit25fbcca96b3254f3ca78dd349c356d9dd5176a52 (patch)
tree696cccb1ccbd96a70b513af8fdfb2dbb45e816ea /src/plugins/projectexplorer/kitmanager.h
parent1d4bf8c157fb14a78d12cf49c7eed3a345f52c1e (diff)
KitManager: Get rid of KitMatcher class
Use std::function instead. Clean up API while at it. Change-Id: I6e401ab57f5375e36710c30508c596af3f4b3385 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/kitmanager.h')
-rw-r--r--src/plugins/projectexplorer/kitmanager.h25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h
index cde9075657..91a3de99e6 100644
--- a/src/plugins/projectexplorer/kitmanager.h
+++ b/src/plugins/projectexplorer/kitmanager.h
@@ -27,6 +27,8 @@
#include "projectexplorer_export.h"
+#include "kit.h"
+
#include <coreplugin/id.h>
#include <coreplugin/featureprovider.h>
@@ -44,7 +46,6 @@ class MacroExpander;
namespace ProjectExplorer {
class Task;
class IOutputParser;
-class Kit;
class KitConfigWidget;
class KitManager;
@@ -106,21 +107,6 @@ private:
int m_priority; // The higher the closer to the top.
};
-class PROJECTEXPLORER_EXPORT KitMatcher
-{
-public:
- typedef std::function<bool(const Kit *)> Matcher;
-
- explicit KitMatcher(const Matcher &m) : m_matcher(m) {}
- KitMatcher() = default;
-
- bool isValid() const { return !!m_matcher; }
- bool matches(const Kit *kit) const { return m_matcher(kit); }
-
-private:
- Matcher m_matcher;
-};
-
class PROJECTEXPLORER_EXPORT KitManager : public QObject
{
Q_OBJECT
@@ -129,10 +115,9 @@ public:
static KitManager *instance();
~KitManager() override;
- static QList<Kit *> kits();
- static QList<Kit *> matchingKits(const KitMatcher &matcher);
- static Kit *find(Core::Id id);
- static Kit *find(const KitMatcher &matcher);
+ static QList<Kit *> kits(const Kit::Predicate &predicate = Kit::Predicate());
+ static Kit *kit(const Kit::Predicate &predicate);
+ static Kit *kit(Core::Id id);
static Kit *defaultKit();
static QList<KitInformation *> kitInformation();