Kits: Upgrade SDK-Kits before trying to them up

This makes sure all keys have the expected names.

Change-Id: I063a88c705de44c4ac079d790ad865e222259b53
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2016-12-14 10:43:18 +01:00
parent f2cd2ac877
commit e76157d285
3 changed files with 11 additions and 0 deletions

View File

@@ -289,6 +289,15 @@ void Kit::setup()
info.at(i)->setup(this);
}
void Kit::upgrade()
{
KitGuard g(this);
// Process the KitInfos in reverse order: They may only be based on other information lower in
// the stack.
for (KitInformation *ki : KitManager::kitInformation())
ki->upgrade(this);
}
QString Kit::unexpandedDisplayName() const
{
return d->m_unexpandedDisplayName;

View File

@@ -69,6 +69,7 @@ public:
void fix(); // Fix the individual kit information: Make sure it contains a valid value.
// Fix will not look at other information in the kit!
void setup(); // Apply advanced magic(TM). Used only once on each kit during initial setup.
void upgrade(); // Upgrade settings to new syntax (if appropriate).
QString unexpandedDisplayName() const;
QString displayName() const;

View File

@@ -165,6 +165,7 @@ void KitManager::restoreKits()
Kit *toStore = 0;
foreach (Kit *current, kitsToValidate) {
toStore = current;
toStore->upgrade();
toStore->setup(); // Make sure all kitinformation are properly set up before merging them
// with the information from the user settings file