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