Skip to content

Commit

Permalink
ide: theme: fix the legacy theme import
Browse files Browse the repository at this point in the history
Some keys weren't imported due to a bad group name. This also patch makes sure
to erase all legacy theme artefacts from the settings file by removing both
highlighting and colors groups.
  • Loading branch information
vdonnefort committed Sep 10, 2014
1 parent ee26ee7 commit cb66411
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions editors/sc-ide/core/settings/theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ int legacyTheme(Manager * settings)
if (settings->contains(group + key)) {
QTextCharFormat fm = settings->value(group + key).value<QTextCharFormat>();
settings->setValue(newGroup + key, QVariant::fromValue<QTextCharFormat>(fm));
settings->remove(group + key);
}
}
settings->remove(group);

group = QString("IDE/editor/highlighting");
group = QString("IDE/editor/highlighting/");
keys.clear();

keys << "keyword" << "built-in" << "env-var" << "class" << "number"
Expand All @@ -67,9 +67,9 @@ int legacyTheme(Manager * settings)
QTextCharFormat fm = theme.format(key);
fm.merge(settings->value(group + key).value<QTextCharFormat>());
settings->setValue(newGroup + key, QVariant::fromValue<QTextCharFormat>(fm));
settings->remove(group + key);
}
}
settings->remove(group);

settings->setValue("IDE/editor/theme", "My old theme");

Expand Down

0 comments on commit cb66411

Please sign in to comment.