forked from qt-creator/qt-creator
ProjectExplorer: Replace ToolChainFactory::canRestore
... by a member-based check. Change-Id: Id7d19e488695e76ea17cf2d02c7b6eb2cd0246cc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -253,18 +253,21 @@ QList<ToolChain *> ToolChainSettingsAccessor::toolChains(const QVariantMap &data
|
||||
const QVariantMap tcMap = data.value(key).toMap();
|
||||
|
||||
bool restored = false;
|
||||
for (ToolChainFactory *f : factories) {
|
||||
if (f->canRestore(tcMap)) {
|
||||
if (ToolChain *tc = f->restore(tcMap)) {
|
||||
result.append(tc);
|
||||
restored = true;
|
||||
break;
|
||||
const Core::Id tcType = ToolChainFactory::typeIdFromMap(tcMap);
|
||||
if (tcType.isValid()) {
|
||||
for (ToolChainFactory *f : factories) {
|
||||
if (f->supportedToolChainType() == tcType) {
|
||||
if (ToolChain *tc = f->restore(tcMap)) {
|
||||
result.append(tc);
|
||||
restored = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!restored)
|
||||
qWarning("Warning: Unable to restore compiler type '%s' for tool chain %s.",
|
||||
qPrintable(ToolChainFactory::typeIdFromMap(tcMap).toString()),
|
||||
qPrintable(tcType.toString()),
|
||||
qPrintable(QString::fromUtf8(ToolChainFactory::idFromMap(tcMap))));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user