ProjectExplorer: Consolidate RunConfig creation codepaths

Move some code around to make interfaces slimmer.
Also no need to check canHandle() twice per creation.

Change-Id: I7c86e2dc78ebd53a0f8e9609e9fa135aaf31e7b7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2018-02-27 09:08:01 +01:00
parent 7acdf911a2
commit 6781217280
5 changed files with 22 additions and 74 deletions

View File

@@ -404,12 +404,7 @@ bool Project::copySteps(Target *sourceTarget, Target *newTarget)
}
foreach (RunConfiguration *sourceRc, sourceTarget->runConfigurations()) {
IRunConfigurationFactory *factory = IRunConfigurationFactory::find(newTarget, sourceRc);
if (!factory) {
runconfigurationError << sourceRc->displayName();
continue;
}
RunConfiguration *newRc = factory->clone(newTarget, sourceRc);
RunConfiguration *newRc = IRunConfigurationFactory::clone(newTarget, sourceRc);
if (!newRc) {
runconfigurationError << sourceRc->displayName();
continue;