Android: Only create Kits for the newest toolchains

It's rare that users will want older toolchains.
In updateAutomaticKits distinguish between a Kit being removed since
the toolchain doesn't exist anymore. Which happens on e.g. changing
the ndk path. If the toolchain still exists, then it isn't the
newest anymore, so demote the Kit to a manual kit thus enabling the
user to remove it if he no longer needs it.

Change-Id: I59203abc9bed5f2c46a002cea68fd72a84283840
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Daniel Teske
2013-08-28 13:34:24 +02:00
parent 7dd56b5b16
commit 0aae98fb13
5 changed files with 145 additions and 5 deletions

View File

@@ -779,6 +779,8 @@ void AndroidConfigurations::updateAutomaticKitList()
foreach (AndroidToolChain *tc, toolchains) {
QList<QtSupport::BaseQtVersion *> qtVersions = qtVersionsForArch.value(tc->targetAbi().architecture());
foreach (QtSupport::BaseQtVersion *qt, qtVersions) {
if (tc->secondaryToolChain())
continue;
Kit *newKit = new Kit;
newKit->setAutoDetected(true);
newKit->setIconPath(Utils::FileName::fromString(QLatin1String(Constants::ANDROID_SETTINGS_CATEGORY_ICON)));
@@ -809,8 +811,15 @@ void AndroidConfigurations::updateAutomaticKitList()
}
}
foreach (Kit *k, existingKits)
KitManager::deregisterKit(k);
foreach (Kit *k, existingKits) {
ProjectExplorer::ToolChain *tc = ToolChainKitInformation::toolChain(k);
if (tc && tc->type() == QLatin1String(Android::Constants::ANDROID_TOOLCHAIN_TYPE)) {
k->makeUnSticky();
k->setAutoDetected(false);
} else {
KitManager::deregisterKit(k);
}
}
foreach (Kit *kit, newKits) {
AndroidToolChain *tc = static_cast<AndroidToolChain *>(ToolChainKitInformation::toolChain(kit));