Merge pull request #13 from jpirnay/fix-cppcheck

chore: Address cppcheck complaints
This commit is contained in:
jpirnay
2026-04-04 09:48:26 +02:00
committed by GitHub
7 changed files with 6 additions and 17 deletions
+2 -1
View File
@@ -9,7 +9,8 @@ capabilities with KOReader, a popular multi-platform open-source epub reader)
Therefore this branch focuses on real fixes and real improvements while trying to keep up to pace with developments in the main branch.
# What's different
- Proper KOReader Snychronisation (including https ssl OOM fix)
- Proper KOReader Snychronisation (including https TLS OOM fix)
- Fixes for a lot of css rendering issues
- Additional sleep screens support (information overlay, transparent pictures over current reader screen)
- Clock-Support
+1 -1
View File
@@ -266,7 +266,7 @@ bool WeatherClient::saveCache(const WeatherData& data) {
d["sunrise"] = day.sunrise;
d["sunset"] = day.sunset;
d["moonPhase"] = day.moonPhase;
d["moonPhaseApiName"] = "moon_phase"; // for compatibility/tracing
d["moonPhaseApiName"] = "moon_phase"; // for compatibility/tracing
}
// Hourly
+1 -1
View File
@@ -3,7 +3,7 @@ default_envs = default
extra_configs = platformio.local.ini
[crosspoint]
version = 1.2.0
version = 1.2.5
[base]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.37/platform-espressif32.zip
+1 -1
View File
@@ -256,7 +256,7 @@ void FileBrowserActivity::loop() {
std::string getFileName(std::string filename) {
if (filename.back() == '/') {
filename = filename.substr(0, filename.length() - 1);
filename.pop_back();
if (!UITheme::getInstance().getTheme().showsFileIcons()) {
return "[" + filename + "]";
}
@@ -466,15 +466,6 @@ void EpubReaderActivity::onReaderMenuConfirm(EpubReaderMenuActivity::MenuAction
if (KOREADER_STORE.hasCredentials()) {
const int currentPage = section ? section->currentPage : 0;
const int totalPages = section ? section->pageCount : 0;
// Look up paragraph index from section cache for accurate XPath generation on upload
uint16_t paragraphIdx = 0;
bool hasParagraphIdx = false;
if (section) {
if (const auto pIdx = section->getParagraphIndexForPage(currentPage)) {
paragraphIdx = *pIdx;
hasParagraphIdx = true;
}
}
startActivityForResult(std::make_unique<KOReaderSyncActivity>(renderer, mappedInput, epub, epub->getPath(),
currentSpineIndex, currentPage, totalPages),
[this](const ActivityResult& result) { handleSyncResult(result); });
@@ -41,7 +41,6 @@ void drawWeatherIconWithOrientation(const GfxRenderer& renderer, const uint8_t*
}
}
StrId getWeatherDescriptionStrId(const int wmoCode) {
switch (wmoCode) {
case 0:
@@ -597,8 +596,6 @@ void WeatherActivity::renderDailyForecast(int x, int y, int w, int h) {
const int extraPx = w % numDays;
int cardX = x;
int debugMoonX = x + w - 18;
int debugMoonYBase = y + 10;
for (int i = 0; i < numDays; i++) {
const auto& day = weatherData.daily[i];
+1 -1
View File
@@ -276,7 +276,7 @@ void BaseTheme::drawList(const GfxRenderer& renderer, Rect rect, int itemCount,
std::string subtitleText = rowSubtitle(i);
const auto nl = subtitleText.find('\n');
if (nl != std::string::npos) {
subtitleText = subtitleText.substr(0, nl) + " \u2022 " + subtitleText.substr(nl + 1);
subtitleText.replace(nl, 1, " \u2022 ");
}
auto subtitle = renderer.truncatedText(UI_10_FONT_ID, subtitleText.c_str(), textWidth);
renderer.drawText(UI_10_FONT_ID, rect.x + BaseMetrics::values.contentSidePadding, itemY + 30, subtitle.c_str(),