forked from qt-creator/qt-creator
Give a qWarning when restoration of kits failed
Change-Id: I5b714d04f40aee6365520fd1b6f76ee1ca7d4cba Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -284,14 +284,18 @@ KitManager::KitList KitManager::restoreKits(const Utils::FileName &fileName)
|
||||
KitList result;
|
||||
|
||||
PersistentSettingsReader reader;
|
||||
if (!reader.load(fileName))
|
||||
if (!reader.load(fileName)) {
|
||||
qWarning("Warning: Failed to read \"%s\", can not restore kits!", qPrintable(fileName.toUserOutput()));
|
||||
return result;
|
||||
}
|
||||
QVariantMap data = reader.restoreValues();
|
||||
|
||||
// Check version:
|
||||
int version = data.value(QLatin1String(KIT_FILE_VERSION_KEY), 0).toInt();
|
||||
if (version < 1)
|
||||
if (version < 1) {
|
||||
qWarning("Warning: Kit file version %d not supported, can not restore kits!", version);
|
||||
return result;
|
||||
}
|
||||
|
||||
const int count = data.value(QLatin1String(KIT_COUNT_KEY), 0).toInt();
|
||||
for (int i = 0; i < count; ++i) {
|
||||
|
Reference in New Issue
Block a user