forked from qt-creator/qt-creator
Toolchains: Store gc--derived toolchains correctly.
Reviewed-by: dt
This commit is contained in:
@@ -415,6 +415,7 @@ bool GccToolChain::fromMap(const QVariantMap &data)
|
|||||||
m_compilerPath = data.value(QLatin1String(compilerPathKeyC)).toString();
|
m_compilerPath = data.value(QLatin1String(compilerPathKeyC)).toString();
|
||||||
m_forcedTo32Bit = data.value(QLatin1String(force32bitKeyC)).toBool();
|
m_forcedTo32Bit = data.value(QLatin1String(force32bitKeyC)).toBool();
|
||||||
m_debuggerCommand = data.value(QLatin1String(debuggerCommandKeyC)).toString();
|
m_debuggerCommand = data.value(QLatin1String(debuggerCommandKeyC)).toString();
|
||||||
|
updateId();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -167,7 +167,6 @@ public:
|
|||||||
virtual bool canRestore(const QVariantMap &data);
|
virtual bool canRestore(const QVariantMap &data);
|
||||||
virtual ToolChain *restore(const QVariantMap &data);
|
virtual ToolChain *restore(const QVariantMap &data);
|
||||||
|
|
||||||
protected:
|
|
||||||
static QString idFromMap(const QVariantMap &data);
|
static QString idFromMap(const QVariantMap &data);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#include <QtCore/QCoreApplication>
|
#include <QtCore/QCoreApplication>
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
|
#include <QtCore/QDir>
|
||||||
|
|
||||||
static const char *const ORGANIZATION_NAME = "Nokia";
|
static const char *const ORGANIZATION_NAME = "Nokia";
|
||||||
static const char *const APPLICATION_NAME = "toolChains";
|
static const char *const APPLICATION_NAME = "toolChains";
|
||||||
@@ -102,15 +102,21 @@ void ToolChainManager::restoreToolChains()
|
|||||||
|
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
settings.setArrayIndex(i);
|
settings.setArrayIndex(i);
|
||||||
QVariantMap tmp = settings.value(QLatin1String(TOOLCHAIN_DATA_KEY)).toMap();
|
const QVariantMap tmp = settings.value(QLatin1String(TOOLCHAIN_DATA_KEY)).toMap();
|
||||||
|
bool restored = false;
|
||||||
foreach (ToolChainFactory *f, factories) {
|
foreach (ToolChainFactory *f, factories) {
|
||||||
if (!f->canRestore(tmp))
|
if (f->canRestore(tmp)) {
|
||||||
continue;
|
if (ToolChain *tc = f->restore(tmp)) {
|
||||||
ToolChain *tc = f->restore(tmp);
|
registerToolChain(tc);
|
||||||
if (!tc)
|
restored = true;
|
||||||
continue;
|
break;
|
||||||
registerToolChain(tc);
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (!restored)
|
||||||
|
qWarning("Warning: Unable to restore manual toolchain '%s' stored in %s.",
|
||||||
|
qPrintable(ToolChainFactory::idFromMap(tmp)),
|
||||||
|
qPrintable(QDir::toNativeSeparators(settings.fileName())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user