mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 20:15:38 +00:00
If the currently configured theme set is missing, attempt to load rbsimple-DE as fallback.
Also added a warning log entry when the selected theme set is missing.
This commit is contained in:
parent
f2e033c383
commit
8c9b664bb1
|
@ -678,8 +678,22 @@ std::string ThemeData::getThemeFromCurrentSet(const std::string& system)
|
|||
std::map<std::string, ThemeSet>::const_iterator set =
|
||||
themeSets.find(Settings::getInstance()->getString("ThemeSet"));
|
||||
if (set == themeSets.cend()) {
|
||||
// Currently configured theme set is missing, so just pick the first available set.
|
||||
set = themeSets.cbegin();
|
||||
// Currently configured theme set is missing, attempt to load the default theme set
|
||||
// rbsimple-DE instead, and if that's also missing then pick the first available set.
|
||||
bool defaultSetFound = true;
|
||||
|
||||
set = themeSets.find("rbsimple-DE");
|
||||
|
||||
if (set == themeSets.cend()) {
|
||||
set = themeSets.cbegin();
|
||||
defaultSetFound = false;
|
||||
}
|
||||
|
||||
LOG(LogWarning) << "Configured theme set \""
|
||||
<< Settings::getInstance()->getString("ThemeSet")
|
||||
<< "\" does not exist, loading" << (defaultSetFound ? " default " : " ")
|
||||
<< "theme set \"" << set->first << "\" instead";
|
||||
|
||||
Settings::getInstance()->setString("ThemeSet", set->first);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue