Commit fba41063 authored by Daniel Teske's avatar Daniel Teske

Android: Mark toolchains from not the current ndk as invalid

And ensure that they are removed on changing the ndk directory.

Change-Id: Ifd3de4d2ac53e93c70b683e11c1368755969ccee
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 28b0e9d3
......@@ -83,7 +83,14 @@ void AndroidSettingsPage::apply()
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
}
// TODO deregister old automatic toolchains?
for (int i = 0; i < existingToolChains.count(); ++i) {
ProjectExplorer::ToolChain *tc = existingToolChains.at(i);
if (tc->type() == QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE)) {
if (!tc->isValid()) {
ProjectExplorer::ToolChainManager::instance()->deregisterToolChain(tc);
}
}
}
AndroidConfigurations::instance().updateAutomaticKitList();
}
......
......@@ -101,7 +101,8 @@ QString AndroidToolChain::typeDisplayName() const
bool AndroidToolChain::isValid() const
{
return GccToolChain::isValid() && targetAbi().isValid() && !m_ndkToolChainVersion.isEmpty();
return GccToolChain::isValid() && targetAbi().isValid() && !m_ndkToolChainVersion.isEmpty()
&& compilerCommand().isChildOf(AndroidConfigurations::instance().config().ndkLocation);
}
void AndroidToolChain::addToEnvironment(Environment &env) const
......
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