MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / onExit

Method onExit

src/activities/reader/EpubReaderActivity.cpp:206–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206void EpubReaderActivity::onExit() {
207 Activity::onExit();
208
209 // Reset orientation back to portrait for the rest of the UI
210 renderer.setOrientation(GfxRenderer::Orientation::Portrait);
211
212 APP_STATE.readerActivityLoadCount = 0;
213 APP_STATE.saveToFile();
214
215 // Leaving mid-footnote loses the in-RAM return stack on deep sleep; persist the
216 // pre-footnote position so the book reopens at the link origin, not the footnote.
217 if (footnoteDepth > 0 && epub) {
218 const SavedPosition& origin = savedPositions[0];
219 saveProgress(origin.spineIndex, origin.pageNumber, 0);
220 }
221
222 section.reset();
223 if (pendingReadFolderMove && epub) {
224 const std::string srcPath = epub->getPath();
225 const std::string oldCachePath = epub->getCachePath();
226 const std::string dstPath = buildReadFolderDestination(srcPath);
227 epub.reset(); // release the Epub (and any open handles) before renaming on the SD card
228 moveFinishedBookToReadFolder(srcPath, dstPath, oldCachePath);
229 } else {
230 epub.reset();
231 }
232}
233
234void EpubReaderActivity::loop() {
235 if (!epub) {

Callers

nothing calls this directly

Calls 6

saveProgressFunction · 0.85
setOrientationMethod · 0.80
saveToFileMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected