Commit 9b1da76c authored by Tobias Hunger's avatar Tobias Hunger
Browse files

QTVersion: Reset toolchain pathes on creator upgrade

Reset the toolchain pathes on creator upgrade. This is necessary
to prevent creator from auto-creating the toolchains found by
reading the settings in the old Qt version configuration which
might override user changes.
parent f5761c92
......@@ -177,31 +177,38 @@ QtVersionManager::QtVersionManager()
// Update from 2.1 or earlier:
QString mingwDir = s->value(QLatin1String("MingwDirectory")).toString();
if (!mingwDir.isEmpty()) {
ProjectExplorer::MingwToolChain *tc = createToolChain<ProjectExplorer::MingwToolChain>(ProjectExplorer::Constants::MINGW_TOOLCHAIN_ID);
if (tc) {
tc->setCompilerPath(QDir::fromNativeSeparators(mingwDir) + QLatin1String("/bin/gcc.exe"));
tc->setDisplayName(tr("MinGW from %1").arg(version->displayName()));
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
QFileInfo fi(mingwDir + QLatin1String("/bin/g++.exe"));
if (fi.exists() && fi.isExecutable()) {
ProjectExplorer::MingwToolChain *tc = createToolChain<ProjectExplorer::MingwToolChain>(ProjectExplorer::Constants::MINGW_TOOLCHAIN_ID);
if (tc) {
tc->setCompilerPath(fi.absoluteFilePath());
tc->setDisplayName(tr("MinGW from %1").arg(version->displayName()));
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
}
}
}
QString mwcDir = s->value(QLatin1String("MwcDirectory")).toString();
if (!mwcDir.isEmpty()) {
WinscwToolChain *tc = createToolChain<WinscwToolChain>(Constants::WINSCW_TOOLCHAIN_ID);
if (tc) {
tc->setCompilerPath(QDir::fromNativeSeparators(mwcDir)
+ QLatin1String("/x86Build/Symbian_Tools/Command_Line_Tools/mwwinrc.exe"));
tc->setDisplayName(tr("WINSCW from %1").arg(version->displayName()));
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
QFileInfo fi(mwcDir + QLatin1String("/x86Build/Symbian_Tools/Command_Line_Tools/mwwinrc.exe"));
if (fi.exists() && fi.isExecutable()) {
WinscwToolChain *tc = createToolChain<WinscwToolChain>(Constants::WINSCW_TOOLCHAIN_ID);
if (tc) {
tc->setCompilerPath(fi.absoluteFilePath());
tc->setDisplayName(tr("WINSCW from %1").arg(version->displayName()));
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
}
}
}
QString gcceDir = s->value(QLatin1String("GcceDirectory")).toString();
if (!gcceDir.isEmpty()) {
GcceToolChain *tc = createToolChain<GcceToolChain>(Constants::GCCE_TOOLCHAIN_ID);
if (tc) {
tc->setCompilerPath(QDir::fromNativeSeparators(gcceDir)
+ QLatin1String("/bin/arm-none-symbianelf-g++.exe"));
tc->setDisplayName(tr("GCCE from %1").arg(version->displayName()));
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
QFileInfo fi(gcceDir + QLatin1String("/bin/arm-none-symbianelf-g++.exe"));
if (fi.exists() && fi.isExecutable()) {
GcceToolChain *tc = createToolChain<GcceToolChain>(Constants::GCCE_TOOLCHAIN_ID);
if (tc) {
tc->setCompilerPath(fi.absoluteFilePath());
tc->setDisplayName(tr("GCCE from %1").arg(version->displayName()));
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
}
}
}
......@@ -369,6 +376,11 @@ void QtVersionManager::writeVersionsIntoSettings()
s->setValue("autodetectionSource", version->autodetectionSource());
s->setValue("S60SDKDirectory", version->systemRoot());
s->setValue(QLatin1String("SBSv2Directory"), version->sbsV2Directory());
// Remove obsolete settings: New toolchains would be created at each startup
// otherwise, overriding manually set ones.
s->remove(QLatin1String("MingwDirectory"));
s->remove(QLatin1String("MwcDirectory"));
s->remove(QLatin1String("GcceDirectory"));
++it;
}
s->endArray();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment