Auto page relocation: ePUB support

This commit is contained in:
Nicolas Mailloux 2021-08-19 19:03:52 -04:00
parent da2ef5232b
commit 4dad8319d2
2 changed files with 11 additions and 1 deletions

View file

@ -1402,6 +1402,9 @@ void reader::writeconfig_pagenumber(bool persistent) {
}
void reader::quit_restart() {
// Saving current page number
saveReadingSettings();
// Cleaning bookconfig_mount mountpoint
string_writeconfig("/opt/ibxd", "bookconfig_unmount\n");
@ -1437,6 +1440,13 @@ void reader::convertMuPdfVars() {
mupdf::fontSize_qstr = QString::number(mupdf::fontSize);
mupdf::width_qstr = QString::number(mupdf::width);
mupdf::height_qstr = QString::number(mupdf::height);
if(global::reader::globalReadingSettings == false) {
if(goToSavedPageDone == false) {
string_checkconfig_ro(".config/A-page_number/config");
mupdf::epubPageNumber = checkconfig_str_val.toInt();
goToSavedPageDone = true;
}
}
if(mupdf::epubPageNumber <= 0) {
mupdf::epubPageNumber = 1;
}
@ -1737,7 +1747,6 @@ void reader::showToast(QString messageToDisplay) {
}
void reader::saveReadingSettings() {
qDebug() << "Got there";
writeconfig_pagenumber(true);
}

View file

@ -56,6 +56,7 @@ public:
bool showTopbarWidget;
bool wordwidgetLock;
bool isNightModeActive;
bool goToSavedPageDone;
QString book_1;
QString book_2;
QString book_3;