forked from qt-creator/qt-creator
ProjectExplorer: Simplify DeployConfigurationFactory interface
Following the RunConfigurationFactory lead this replaces f = Foo::find(); f->do() by static Foo::do() stanzas. Also protect DeployConfigurationFactory::canCreate() Change-Id: I80fa491f836c3b9186f6ce6dccac4d52d4b80fc8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -773,18 +773,13 @@ bool Target::fromMap(const QVariantMap &map)
|
||||
if (!map.contains(key))
|
||||
return false;
|
||||
QVariantMap valueMap = map.value(key).toMap();
|
||||
DeployConfigurationFactory *factory = DeployConfigurationFactory::find(this, valueMap);
|
||||
if (!factory) {
|
||||
DeployConfiguration *dc = DeployConfigurationFactory::restore(this, valueMap);
|
||||
if (!dc) {
|
||||
Core::Id id = idFromMap(valueMap);
|
||||
qWarning("No factory found to restore deployment configuration of id '%s'!",
|
||||
id.isValid() ? qPrintable(id.toString()) : "UNKNOWN");
|
||||
continue;
|
||||
}
|
||||
DeployConfiguration *dc = factory->restore(this, valueMap);
|
||||
if (!dc) {
|
||||
qWarning("Factory '%s' failed to restore deployment configuration!", qPrintable(factory->objectName()));
|
||||
continue;
|
||||
}
|
||||
QTC_CHECK(dc->id().withSuffix(dc->extraId()) == ProjectExplorer::idFromMap(valueMap));
|
||||
addDeployConfiguration(dc);
|
||||
if (i == activeConfiguration)
|
||||
|
||||
Reference in New Issue
Block a user