summaryrefslogtreecommitdiff
path: root/src/plugins/baremetal
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-11-10 15:43:23 +0100
committerhjk <hjk@qt.io>2017-11-14 10:58:30 +0000
commitdfd4ad8c2d177cf6415f457cdcf62dbc3b17a6a3 (patch)
treeb5640b58e3ceb1ef60f176b3bb7b12aac289263a /src/plugins/baremetal
parent5483d45e5e2147dd3f18341401dd7c35e44a04d2 (diff)
downloadqt-creator-dfd4ad8c2d177cf6415f457cdcf62dbc3b17a6a3.tar.gz
ProjectExplorer: Simplify IRunConfigurationFactory::clone() use
Change-Id: I005d6c87142d26dfc7ae1349329737a68f54c427 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/baremetal')
-rw-r--r--src/plugins/baremetal/baremetalrunconfigurationfactory.cpp16
-rw-r--r--src/plugins/baremetal/baremetalrunconfigurationfactory.h10
2 files changed, 5 insertions, 21 deletions
diff --git a/src/plugins/baremetal/baremetalrunconfigurationfactory.cpp b/src/plugins/baremetal/baremetalrunconfigurationfactory.cpp
index 8ab6a72015..31f19dfa6b 100644
--- a/src/plugins/baremetal/baremetalrunconfigurationfactory.cpp
+++ b/src/plugins/baremetal/baremetalrunconfigurationfactory.cpp
@@ -63,7 +63,8 @@ static bool canHandle(const Target *target)
BareMetalRunConfigurationFactory::BareMetalRunConfigurationFactory(QObject *parent) :
IRunConfigurationFactory(parent)
{
- setObjectName(QLatin1String("BareMetalRunConfigurationFactory"));
+ setObjectName("BareMetalRunConfigurationFactory");
+ registerRunConfiguration<BareMetalRunConfiguration>();
}
bool BareMetalRunConfigurationFactory::canCreate(Target *parent, Core::Id id) const
@@ -116,12 +117,6 @@ RunConfiguration *BareMetalRunConfigurationFactory::doRestore(Target *parent, co
return doCreate(parent,Core::Id(BareMetalRunConfiguration::IdPrefix));
}
-RunConfiguration *BareMetalRunConfigurationFactory::clone(Target *parent, RunConfiguration *source)
-{
- QTC_ASSERT(canClone(parent, source), return 0);
- return cloneHelper<BareMetalRunConfiguration>(parent, source);
-}
-
// BareMetalCustomRunConfigurationFactory
@@ -129,6 +124,7 @@ BareMetalCustomRunConfigurationFactory::BareMetalCustomRunConfigurationFactory(Q
IRunConfigurationFactory(parent)
{
setObjectName("BareMetalCustomRunConfigurationFactory");
+ registerRunConfiguration<BareMetalCustomRunConfiguration>();
}
bool BareMetalCustomRunConfigurationFactory::canCreate(Target *parent, Core::Id id) const
@@ -178,11 +174,5 @@ RunConfiguration *BareMetalCustomRunConfigurationFactory::doRestore(Target *pare
return new BareMetalCustomRunConfiguration(parent);
}
-RunConfiguration *BareMetalCustomRunConfigurationFactory::clone(Target *parent, RunConfiguration *source)
-{
- QTC_ASSERT(canClone(parent, source), return 0);
- return cloneHelper<BareMetalCustomRunConfiguration>(parent, source);
-}
-
} // namespace Internal
} // namespace BareMetal
diff --git a/src/plugins/baremetal/baremetalrunconfigurationfactory.h b/src/plugins/baremetal/baremetalrunconfigurationfactory.h
index cb57ae23a1..42226ab4c3 100644
--- a/src/plugins/baremetal/baremetalrunconfigurationfactory.h
+++ b/src/plugins/baremetal/baremetalrunconfigurationfactory.h
@@ -41,12 +41,9 @@ public:
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const override;
bool canCreate(ProjectExplorer::Target *parent, Core::Id id) const override;
-
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const override;
-
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const override;
- ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent,
- ProjectExplorer::RunConfiguration *source) override;
+
private:
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, Core::Id id) override;
ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,
@@ -64,12 +61,9 @@ public:
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const override;
bool canCreate(ProjectExplorer::Target *parent, Core::Id id) const override;
-
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const override;
-
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const override;
- ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent,
- ProjectExplorer::RunConfiguration *source) override;
+
private:
ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, Core::Id id) override;
ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent,