ProjectExplorer: Simplify IRunConfigurationFactory::clone() use

Change-Id: I005d6c87142d26dfc7ae1349329737a68f54c427
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
hjk
2017-11-10 15:43:23 +01:00
parent 5483d45e5e
commit dfd4ad8c2d
27 changed files with 55 additions and 170 deletions

View File

@@ -278,6 +278,7 @@ public:
PythonRunConfigurationFactory()
{
setObjectName("PythonRunConfigurationFactory");
registerRunConfiguration<PythonRunConfiguration>();
}
QList<Core::Id> availableCreationIds(Target *parent, CreationMode mode) const override
@@ -323,13 +324,6 @@ public:
return source->id().name().startsWith(PythonRunConfigurationPrefix);
}
RunConfiguration *clone(Target *parent, RunConfiguration *source) override
{
if (!canClone(parent, source))
return 0;
return cloneHelper<PythonRunConfiguration>(parent, source);
}
private:
bool canHandle(Target *parent) const { return dynamic_cast<PythonProject *>(parent->project()); }