Sync to master

This commit is contained in:
jpirnay
2026-03-07 10:29:41 +01:00
parent 34a96d717d
commit 9ca0f30b16
+6 -6
View File
@@ -456,11 +456,11 @@ void SleepActivity::renderOverlaySleepScreen() const {
const auto& path = APP_STATE.openEpubPath; const auto& path = APP_STATE.openEpubPath;
bool rendered = false; bool rendered = false;
if (StringUtils::checkFileExtension(path, ".xtc") || StringUtils::checkFileExtension(path, ".xtch")) { if (FsHelpers::checkFileExtension(path, ".xtc") || FsHelpers::checkFileExtension(path, ".xtch")) {
rendered = XtcReaderActivity::drawCurrentPageToBuffer(path, renderer); rendered = XtcReaderActivity::drawCurrentPageToBuffer(path, renderer);
} else if (StringUtils::checkFileExtension(path, ".txt")) { } else if (FsHelpers::checkFileExtension(path, ".txt")) {
rendered = TxtReaderActivity::drawCurrentPageToBuffer(path, renderer); rendered = TxtReaderActivity::drawCurrentPageToBuffer(path, renderer);
} else if (StringUtils::checkFileExtension(path, ".epub")) { } else if (FsHelpers::checkFileExtension(path, ".epub")) {
rendered = EpubReaderActivity::drawCurrentPageToBuffer(path, renderer); rendered = EpubReaderActivity::drawCurrentPageToBuffer(path, renderer);
} }
@@ -569,8 +569,8 @@ void SleepActivity::renderOverlaySleepScreen() const {
file.close(); file.close();
continue; continue;
} }
const bool isBmp = StringUtils::checkFileExtension(filename, ".bmp"); const bool isBmp = FsHelpers::checkFileExtension(filename, ".bmp");
const bool isPng = StringUtils::checkFileExtension(filename, ".png"); const bool isPng = FsHelpers::checkFileExtension(filename, ".png");
if (!isBmp && !isPng) { if (!isBmp && !isPng) {
file.close(); file.close();
continue; continue;
@@ -594,7 +594,7 @@ void SleepActivity::renderOverlaySleepScreen() const {
APP_STATE.lastSleepImage = randomFileIndex; APP_STATE.lastSleepImage = randomFileIndex;
APP_STATE.saveToFile(); APP_STATE.saveToFile();
const std::string selected = "/sleep/" + files[randomFileIndex]; const std::string selected = "/sleep/" + files[randomFileIndex];
if (StringUtils::checkFileExtension(selected, ".png")) { if (FsHelpers::checkFileExtension(selected, ".png")) {
overlayDrawn = tryDrawPngOverlay(selected); overlayDrawn = tryDrawPngOverlay(selected);
} else { } else {
overlayDrawn = tryDrawOverlay(selected); overlayDrawn = tryDrawOverlay(selected);