mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 22:57:50 +03:00
fix(cppcheck): clang format
This commit is contained in:
parent
e6b3ecc519
commit
c6cfaa38af
@ -56,9 +56,7 @@ UIElement* ThemeManager::createElement(const std::string& id, const std::string&
|
||||
}
|
||||
|
||||
// Parse integer safely - returns 0 on error
|
||||
static int parseIntSafe(const std::string& val) {
|
||||
return static_cast<int>(std::strtol(val.c_str(), nullptr, 10));
|
||||
}
|
||||
static int parseIntSafe(const std::string& val) { return static_cast<int>(std::strtol(val.c_str(), nullptr, 10)); }
|
||||
|
||||
void ThemeManager::applyProperties(UIElement* elem, const std::map<std::string, std::string>& props) {
|
||||
const auto elemType = elem->getType();
|
||||
|
||||
@ -44,16 +44,16 @@ constexpr int controlsSettingsCount = 4;
|
||||
const SettingInfo controlsSettings[controlsSettingsCount] = {
|
||||
SettingInfo::Enum("Front Button Layout", &CrossPointSettings::frontButtonLayout,
|
||||
{"Bck, Cnfrm, Lft, Rght", "Lft, Rght, Bck, Cnfrm", "Lft, Bck, Cnfrm, Rght"}),
|
||||
SettingInfo::Enum("Side Button Layout (reader)", &CrossPointSettings::sideButtonLayout, {"Prev, Next", "Next, Prev"}),
|
||||
SettingInfo::Enum("Side Button Layout (reader)", &CrossPointSettings::sideButtonLayout,
|
||||
{"Prev, Next", "Next, Prev"}),
|
||||
SettingInfo::Toggle("Long-press Chapter Skip", &CrossPointSettings::longPressChapterSkip),
|
||||
SettingInfo::Enum("Short Power Button Click", &CrossPointSettings::shortPwrBtn, {"Ignore", "Sleep", "Page Turn"})};
|
||||
|
||||
constexpr int systemSettingsCount = 5;
|
||||
const SettingInfo systemSettings[systemSettingsCount] = {
|
||||
SettingInfo::Enum("Time to Sleep", &CrossPointSettings::sleepTimeout, {"1 min", "5 min", "10 min", "15 min", "30 min"}),
|
||||
SettingInfo::Action("KOReader Sync"),
|
||||
SettingInfo::Action("Calibre Settings"),
|
||||
SettingInfo::Action("Clear Cache"),
|
||||
SettingInfo::Enum("Time to Sleep", &CrossPointSettings::sleepTimeout,
|
||||
{"1 min", "5 min", "10 min", "15 min", "30 min"}),
|
||||
SettingInfo::Action("KOReader Sync"), SettingInfo::Action("Calibre Settings"), SettingInfo::Action("Clear Cache"),
|
||||
SettingInfo::Action("Check for updates")};
|
||||
|
||||
// All categories with their settings
|
||||
@ -63,8 +63,7 @@ struct CategoryData {
|
||||
int count;
|
||||
};
|
||||
|
||||
const CategoryData allCategories[4] = {
|
||||
{"Display", displaySettings, displaySettingsCount},
|
||||
const CategoryData allCategories[4] = {{"Display", displaySettings, displaySettingsCount},
|
||||
{"Reader", readerSettings, readerSettingsCount},
|
||||
{"Controls", controlsSettings, controlsSettingsCount},
|
||||
{"System", systemSettings, systemSettingsCount}};
|
||||
@ -186,8 +185,8 @@ void SettingsActivity::enterCategoryLegacy(int categoryIndex) {
|
||||
xSemaphoreTake(renderingMutex, portMAX_DELAY);
|
||||
exitActivity();
|
||||
enterNewActivity(new CategorySettingsActivity(renderer, mappedInput, allCategories[categoryIndex].name,
|
||||
allCategories[categoryIndex].settings, allCategories[categoryIndex].count,
|
||||
[this] {
|
||||
allCategories[categoryIndex].settings,
|
||||
allCategories[categoryIndex].count, [this] {
|
||||
exitActivity();
|
||||
updateRequired = true;
|
||||
}));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user