aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/kitmanager.h
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2018-07-03 11:49:25 +0200
committerTobias Hunger <tobias.hunger@qt.io>2018-07-11 08:29:19 +0000
commit05fb67fee72472f04991dc6579ace3b15e510177 (patch)
tree0a1a2b164f7da20651b8c208b36c3010250b2505 /src/plugins/projectexplorer/kitmanager.h
parent6aeb06c8d3889e03180d73db0a472ff619da887f (diff)
ProjectExplorer: Use unique_ptr to store KitInformation
Change-Id: I406b6bed005fb7455e6ee41d81a2f314584a051a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/kitmanager.h')
-rw-r--r--src/plugins/projectexplorer/kitmanager.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h
index 6c034db428..16377df37b 100644
--- a/src/plugins/projectexplorer/kitmanager.h
+++ b/src/plugins/projectexplorer/kitmanager.h
@@ -130,7 +130,10 @@ public:
static void deregisterKit(Kit *k);
static void setDefaultKit(Kit *k);
- static void registerKitInformation(KitInformation *ki);
+ template<typename KI, typename... Args>
+ static void registerKitInformation(Args&&... args) {
+ registerKitInformation(std::make_unique<KI>(std::forward<Args>(args)...));
+ }
static QSet<Core::Id> supportedPlatforms();
static QSet<Core::Id> availableFeatures(Core::Id platformId);
@@ -158,6 +161,8 @@ signals:
private:
explicit KitManager(QObject *parent = nullptr);
+ static void registerKitInformation(std::unique_ptr<KitInformation> &&ki);
+
// Make sure the this is only called after all
// KitInformation are registered!
void restoreKits();