add library with reading history, progress tracking, and view persistence
This commit is contained in:
15 files changed
+685
-40
No files matched your search
@@ -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();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user