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

@@ -815,10 +815,7 @@ bool Target::fromMap(const QVariantMap &map)
// Ignore missing RCs: We will just populate them using the default ones.
QVariantMap valueMap = map.value(key).toMap();
IRunConfigurationFactory *factory = IRunConfigurationFactory::find(this, valueMap);
if (!factory)
continue;
RunConfiguration *rc = factory->restore(this, valueMap);
RunConfiguration *rc = IRunConfigurationFactory::restore(this, valueMap);
if (!rc)
continue;
QTC_CHECK(rc->id().withSuffix(rc->extraId()) == ProjectExplorer::idFromMap(valueMap));