add library with reading history, progress tracking, and view persistence

This commit is contained in:
Agel committed 2026-03-20 11:20:16 +01:00
1 parent c62733bc26
commit c4046d8533
15 files changed
+685 -40

No files matched your search

+11
View File
@@ -31,6 +31,7 @@ int main(int argc, char *argv[])
AppState appState;
appState.restore();
bookController.setAppState(&appState);
QQmlApplicationEngine engine;
@@ -48,6 +49,16 @@ int main(int argc, char *argv[])
if (bookController.hasBook()) {
appState.setLastFilePath(bookController.currentFilePath());
appState.setLastChapter(readingModel.currentChapter());
appState.saveBookPosition(bookController.currentFilePath(),
readingModel.currentChapter(),
appState.lastScrollIndex(),
appState.lastScrollOffset());
appState.addOrUpdateLibraryBook(bookController.currentFilePath(),
bookController.bookTitle(),
bookController.bookAuthor(),
readingModel.progress());
} else {
appState.setLastFilePath(QString());
}
appState.save();
});