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

@@ -198,7 +198,7 @@ void ToolChainManager::restoreToolChains()
restoreFromFile(FileName::fromString(systemSettingsFile.absolutePath() + QLatin1String(TOOLCHAIN_FILENAME)));
// make sure we mark these as autodetected!
foreach (ToolChain *tc, readTcs)
tc->setAutoDetected(true);
tc->setDetection(ToolChain::AutoDetection);
tcsToRegister = readTcs; // SDK TCs are always considered to be up-to-date, so no need to
// recheck them.
@@ -239,10 +239,12 @@ void ToolChainManager::restoreToolChains()
foreach (ToolChain *currentDetected, detectedTcs) {
toStore = currentDetected;
// Check whether we had this TC stored and prefer the old one with the old id:
// Check whether we had this TC stored and prefer the old one with the old id, marked
// as auto-detection.
for (int i = 0; i < tcsToCheck.count(); ++i) {
if (*(tcsToCheck.at(i)) == *currentDetected) {
toStore = tcsToCheck.at(i);
toStore->setDetection(ToolChain::AutoDetection);
tcsToCheck.removeAt(i);
delete currentDetected;
break;