Fix maemo tool chain creation on Qt version changes

Make sure the old maemo tool chain is removed before adding it
again.

Change-Id: Iecb77455c21962a25576fca39d32bb35fe638722
Reviewed-on: http://codereview.qt.nokia.com/227
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Tobias Hunger
2011-05-30 14:12:22 +00:00
parent cf62837fab
commit 03047888b5

View File

@@ -304,8 +304,7 @@ QList<ProjectExplorer::ToolChain *> MaemoToolChainFactory::createToolChainList(c
foreach (int i, changes) {
QtSupport::BaseQtVersion *v = vm->version(i);
if (!v || !v->isValid()) {
// remove tool chain:
// remove tool chain (on removal, change or addition:
QList<ProjectExplorer::ToolChain *> toRemove;
foreach (ProjectExplorer::ToolChain *tc, tcm->toolChains()) {
if (!tc->id().startsWith(QLatin1String(Constants::MAEMO_TOOLCHAIN_ID)))
@@ -316,7 +315,9 @@ QList<ProjectExplorer::ToolChain *> MaemoToolChainFactory::createToolChainList(c
}
foreach (ProjectExplorer::ToolChain *tc, toRemove)
tcm->deregisterToolChain(tc);
} else if (MaemoQtVersion *mqv = dynamic_cast<MaemoQtVersion *>(v)) {
// (Re-)add toolchain:
if (MaemoQtVersion *mqv = dynamic_cast<MaemoQtVersion *>(v)) {
// add tool chain:
MaemoToolChain *mTc = new MaemoToolChain(true);
mTc->setQtVersionId(i);