diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 1e8a4dc3785aee8fbdbb3801004363750c1a99e3..d72e1d68a57e7ac12a1f6b52c619d91cb656c8cd 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -154,26 +154,25 @@ void KitManager::restoreKits() // read all kits from SDK QFileInfo systemSettingsFile(Core::ICore::settings(QSettings::SystemScope)->fileName()); - KitList system = restoreKits(Utils::FileName::fromString(systemSettingsFile.absolutePath() + QLatin1String(KIT_FILENAME))); - QList<Kit *> readKits = system.kits; - // make sure we mark these as autodetected! - foreach (Kit *k, readKits) - k->setAutoDetected(true); - - kitsToRegister = readKits; // SDK kits are always considered to be up-to-date, so no need to - // recheck them. + QFileInfo kitFile(systemSettingsFile.absolutePath(), QLatin1String(KIT_FILENAME)); + if (kitFile.exists()) { + KitList system = restoreKits(Utils::FileName(kitFile)); + // make sure we mark these as autodetected! + foreach (Kit *k, system.kits) + k->setAutoDetected(true); + + // SDK kits are always considered to be up-to-date, so no need to recheck them. + kitsToRegister = system.kits; + } // read all kit chains from user file KitList userKits = restoreKits(settingsFileName()); - readKits = userKits.kits; - - foreach (Kit *k, readKits) { + foreach (Kit *k, userKits.kits) { if (k->isAutoDetected()) kitsToCheck.append(k); else kitsToRegister.append(k); } - readKits.clear(); // Then auto create kits: QList<Kit *> detectedKits;