forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user