| 25 | } // namespace |
| 26 | |
| 27 | void 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 | |
| 49 | void TxtReaderActivity::onExit() { |
| 50 | Activity::onExit(); |
nothing calls this directly
no test coverage detected