Review fixes

This commit is contained in:
jpirnay
2026-04-12 22:25:12 +02:00
parent d2b13e7a43
commit bec30e3403
4 changed files with 27 additions and 8 deletions
+1 -1
View File
@@ -478,7 +478,7 @@ STR_READER_APPEARANCE: "Appearance"
STR_MENU_SYS_SYSTEM: "System"
STR_MENU_SYS_NETWORK: "Network"
STR_MENU_SYS_TOOLS: "Tools"
STR_MENU_DISP_SLEEP: "Sleepscreen"
STR_MENU_DISP_SLEEP: "Sleep Screen"
STR_MENU_DISP_BATTERY: "Battery symbol"
STR_MENU_DISP_REFRESH: "Screen refresh"
STR_MENU_READER_FONT: "Reader Font"
+23 -1
View File
@@ -281,7 +281,29 @@ def find_used_string_keys(
except OSError:
continue
for line in text.splitlines():
line = line.split("//", 1)[0]
quote_char = None
escaped = False
comment_index = None
for idx, ch in enumerate(line):
if escaped:
escaped = False
continue
if quote_char is None:
if ch == '"' or ch == "'":
quote_char = ch
continue
if ch == "/" and idx + 1 < len(line) and line[idx + 1] == "/":
comment_index = idx
break
else:
if ch == "\\":
escaped = True
continue
if ch == quote_char:
quote_char = None
continue
if comment_index is not None:
line = line[:comment_index]
for m in pattern.finditer(line):
used.add(m.group(0))
+3 -3
View File
@@ -73,9 +73,9 @@ void SettingInfo::toggleValue() const {
case SettingType::VALUE:
if (valuePtr) {
const auto current = static_cast<int8_t>(SETTINGS.*(valuePtr));
SETTINGS.*(valuePtr) =
(current + valueRange.step > valueRange.max) ? valueRange.min : current + valueRange.step;
const unsigned current = SETTINGS.*(valuePtr);
SETTINGS.*(valuePtr) = static_cast<uint8_t>(
(current + valueRange.step > valueRange.max) ? valueRange.min : current + valueRange.step);
}
break;
-3
View File
@@ -204,12 +204,9 @@ void setup() {
HalSystem::checkPanic();
HalSystem::clearPanic(); // TODO: move this to an activity when we have one to display the panic info
LOG_DBG("MAIN", "System initialized, now setting up environment, millis=%lu", millis());
SETTINGS.loadFromFile();
LOG_DBG("MAIN", "Settings loaded, now setting up clock and localization, millis=%lu", millis());
HalClock::applyTimezone(SETTINGS.timeZone);
I18N.loadSettings();
LOG_DBG("MAIN", "Localization loaded, now setting up theme and button navigation, millis=%lu", millis());
KOREADER_STORE.loadFromFile();
WEATHER_SETTINGS.loadFromFile();
UITheme::getInstance().reload();