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

Method onEnter

src/activities/reader/TxtReaderActivity.cpp:27–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25} // namespace
26
27void TxtReaderActivity::onEnter() {
28 Activity::onEnter();
29
30 if (!txt) {
31 return;
32 }
33
34 ReaderUtils::applyOrientation(renderer, SETTINGS.orientation);
35
36 txt->setupCacheDir();
37
38 // Save current txt as last opened file and add to recent books
39 auto filePath = txt->getPath();
40 auto fileName = filePath.substr(filePath.rfind('/') + 1);
41 APP_STATE.openEpubPath = filePath;
42 APP_STATE.saveToFile();
43 RECENT_BOOKS.addBook(filePath, fileName, "", "");
44
45 // Trigger first update
46 requestUpdate();
47}
48
49void TxtReaderActivity::onExit() {
50 Activity::onExit();

Callers

nothing calls this directly

Calls 4

applyOrientationFunction · 0.85
addBookMethod · 0.80
setupCacheDirMethod · 0.45
saveToFileMethod · 0.45

Tested by

no test coverage detected