Introduce an enumeration for toolchain autodetection.

Replace boolean "autodetect" by an enumeration with a value
AutoDetectionFromSettings indicating whether the Autodetection
originates from a settings file. Enable the "Remove" button for
those cases.

Currently, there is no way to remove toolchains that were once
autodetected and are no longer present. This happens for example
when working in different MinGW environments, which then
clutter up the toolchain options page and dramatically slow
down the options page opening since gcc is launched to query
the flags, etc.

Change-Id: I731168d8694fe56f60d909f9779f83cffa55fd44
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Friedemann Kleint
2013-09-03 10:58:59 +02:00
parent f1d18ba38b
commit 1226400af3
17 changed files with 94 additions and 81 deletions

View File

@@ -66,8 +66,8 @@ static const char ANDROID_NDK_TC_VERION[] = "Qt4ProjectManager.Android.NDK_TC_VE
QMap<ProjectExplorer::Abi::Architecture, QList<int> > AndroidToolChainFactory::m_newestVersionForArch;
Utils::FileName AndroidToolChainFactory::m_ndkLocation;
AndroidToolChain::AndroidToolChain(Abi::Architecture arch, const QString &ndkToolChainVersion, bool autodetected)
: GccToolChain(QLatin1String(Constants::ANDROID_TOOLCHAIN_ID), autodetected),
AndroidToolChain::AndroidToolChain(Abi::Architecture arch, const QString &ndkToolChainVersion, Detection d)
: GccToolChain(QLatin1String(Constants::ANDROID_TOOLCHAIN_ID), d),
m_ndkToolChainVersion(ndkToolChainVersion), m_secondaryToolChain(false)
{
ProjectExplorer::Abi abi = ProjectExplorer::Abi(arch, ProjectExplorer::Abi::LinuxOS,
@@ -81,7 +81,7 @@ AndroidToolChain::AndroidToolChain(Abi::Architecture arch, const QString &ndkToo
// for fromMap
AndroidToolChain::AndroidToolChain()
: GccToolChain(QLatin1String(Constants::ANDROID_TOOLCHAIN_ID), false),
: GccToolChain(QLatin1String(Constants::ANDROID_TOOLCHAIN_ID), ToolChain::ManualDetection),
m_secondaryToolChain(false)
{
}
@@ -383,7 +383,7 @@ QList<ToolChain *> AndroidToolChainFactory::createToolChainsForNdk(const Utils::
Abi::Architecture arch = AndroidConfigurations::architectureForToolChainPrefix(platform);
if (arch == Abi::UnknownArchitecture) // e.g. mipsel which is not yet supported
continue;
AndroidToolChain *tc = new AndroidToolChain(arch, version, true);
AndroidToolChain *tc = new AndroidToolChain(arch, version, ToolChain::AutoDetection);
FileName compilerPath = AndroidConfigurations::instance().gccPath(arch, version);
tc->setCompilerCommand(compilerPath);
result.append(tc);