Renamed suppressedTransitionEntries to suppressedTransitionProfiles.

This commit is contained in:
Leon Styhre 2023-01-08 19:30:16 +01:00
parent 3d5eb2a3cf
commit 656c3661ea
3 changed files with 29 additions and 29 deletions

View file

@ -360,24 +360,24 @@ void GuiMenu::openUIOptions()
transitionAnim == selectedTransitionAnimation);
}
}
if (std::find(currentSet->second.capabilities.suppressedTransitionEntries.cbegin(),
currentSet->second.capabilities.suppressedTransitionEntries.cend(),
if (std::find(currentSet->second.capabilities.suppressedTransitionProfiles.cbegin(),
currentSet->second.capabilities.suppressedTransitionProfiles.cend(),
"builtin-instant") ==
currentSet->second.capabilities.suppressedTransitionEntries.cend()) {
currentSet->second.capabilities.suppressedTransitionProfiles.cend()) {
themeTransitionAnimations->add("INSTANT (BUILT-IN)", "builtin-instant",
"builtin-instant" == selectedTransitionAnimation);
}
if (std::find(currentSet->second.capabilities.suppressedTransitionEntries.cbegin(),
currentSet->second.capabilities.suppressedTransitionEntries.cend(),
if (std::find(currentSet->second.capabilities.suppressedTransitionProfiles.cbegin(),
currentSet->second.capabilities.suppressedTransitionProfiles.cend(),
"builtin-slide") ==
currentSet->second.capabilities.suppressedTransitionEntries.cend()) {
currentSet->second.capabilities.suppressedTransitionProfiles.cend()) {
themeTransitionAnimations->add("SLIDE (BUILT-IN)", "builtin-slide",
"builtin-slide" == selectedTransitionAnimation);
}
if (std::find(currentSet->second.capabilities.suppressedTransitionEntries.cbegin(),
currentSet->second.capabilities.suppressedTransitionEntries.cend(),
if (std::find(currentSet->second.capabilities.suppressedTransitionProfiles.cbegin(),
currentSet->second.capabilities.suppressedTransitionProfiles.cend(),
"builtin-fade") ==
currentSet->second.capabilities.suppressedTransitionEntries.cend()) {
currentSet->second.capabilities.suppressedTransitionProfiles.cend()) {
themeTransitionAnimations->add("FADE (BUILT-IN)", "builtin-fade",
"builtin-fade" == selectedTransitionAnimation);
}

View file

@ -906,10 +906,10 @@ void ThemeData::setThemeTransitions()
}
else if (transitionSetting == "builtin-slide" || transitionSetting == "builtin-fade") {
if (std::find(
mCurrentThemeSet->second.capabilities.suppressedTransitionEntries.cbegin(),
mCurrentThemeSet->second.capabilities.suppressedTransitionEntries.cend(),
mCurrentThemeSet->second.capabilities.suppressedTransitionProfiles.cbegin(),
mCurrentThemeSet->second.capabilities.suppressedTransitionProfiles.cend(),
transitionSetting) ==
mCurrentThemeSet->second.capabilities.suppressedTransitionEntries.cend()) {
mCurrentThemeSet->second.capabilities.suppressedTransitionProfiles.cend()) {
if (transitionSetting == "builtin-slide") {
transitionAnim = static_cast<int>(ViewTransitionAnimation::SLIDE);
}
@ -1350,37 +1350,37 @@ ThemeData::ThemeCapability ThemeData::parseThemeCapabilities(const std::string&
}
}
for (pugi::xml_node suppressTransitionEntries {
themeCapabilities.child("suppressTransitionEntries")};
suppressTransitionEntries;
suppressTransitionEntries =
suppressTransitionEntries.next_sibling("suppressTransitionEntries")) {
std::vector<std::string> readSuppressEntries;
for (pugi::xml_node suppressTransitionProfiles {
themeCapabilities.child("suppressTransitionProfiles")};
suppressTransitionProfiles;
suppressTransitionProfiles =
suppressTransitionProfiles.next_sibling("suppressTransitionProfiles")) {
std::vector<std::string> readSuppressProfiles;
for (pugi::xml_node entries {suppressTransitionEntries.child("entry")}; entries;
for (pugi::xml_node entries {suppressTransitionProfiles.child("entry")}; entries;
entries = entries.next_sibling("entry")) {
const std::string& entryValue {entries.text().as_string()};
if (std::find(sSupportedTransitionAnimations.cbegin(),
sSupportedTransitionAnimations.cend(),
entryValue) != sSupportedTransitionAnimations.cend()) {
capabilities.suppressedTransitionEntries.emplace_back(entryValue);
capabilities.suppressedTransitionProfiles.emplace_back(entryValue);
}
else {
LOG(LogWarning)
<< "Found suppressTransitionEntries <entry> tag with invalid value \""
<< "Found suppressTransitionProfiles <entry> tag with invalid value \""
<< entryValue << "\", ignoring entry in \"" << capFile << "\"";
}
}
// Sort and remove any duplicates.
if (capabilities.suppressedTransitionEntries.size() > 1) {
std::sort(capabilities.suppressedTransitionEntries.begin(),
capabilities.suppressedTransitionEntries.end());
auto last = std::unique(capabilities.suppressedTransitionEntries.begin(),
capabilities.suppressedTransitionEntries.end());
capabilities.suppressedTransitionEntries.erase(
last, capabilities.suppressedTransitionEntries.end());
if (capabilities.suppressedTransitionProfiles.size() > 1) {
std::sort(capabilities.suppressedTransitionProfiles.begin(),
capabilities.suppressedTransitionProfiles.end());
auto last = std::unique(capabilities.suppressedTransitionProfiles.begin(),
capabilities.suppressedTransitionProfiles.end());
capabilities.suppressedTransitionProfiles.erase(
last, capabilities.suppressedTransitionProfiles.end());
}
}
}

View file

@ -216,7 +216,7 @@ public:
std::vector<ThemeColorScheme> colorSchemes;
std::vector<std::string> aspectRatios;
std::vector<ThemeTransitions> transitions;
std::vector<std::string> suppressedTransitionEntries;
std::vector<std::string> suppressedTransitionProfiles;
bool legacyTheme;
};