From 0abce1970bda87b9cb4187b59e02ed1576305f60 Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Thu, 19 Aug 2021 19:37:07 -0400 Subject: [PATCH] Auto page relocation for plain text files implemented --- reader.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reader.cpp b/reader.cpp index 6e43605..133b89a 100644 --- a/reader.cpp +++ b/reader.cpp @@ -395,6 +395,12 @@ reader::reader(QWidget *parent) : // Get text; no need to do it multiple times for ePUB books if(is_epub != true) { setDefaultWorkDir(); + if(global::reader::globalReadingSettings == false) { + string_checkconfig_ro(".config/A-page_number/config"); + if(checkconfig_str_val != "") { + split_total = checkconfig_str_val.toInt(); + } + } setup_book(book_file, split_total, true); } @@ -1389,6 +1395,7 @@ void reader::writeconfig_pagenumber(bool persistent) { std::string split_total_str = std::to_string(split_total); string_writeconfig("/tmp/inkboxPageNumber", split_total_str); if(persistent == true) { + split_total_str.append("\n"); string_writeconfig(".config/A-page_number/config", split_total_str); } } @@ -1396,6 +1403,7 @@ void reader::writeconfig_pagenumber(bool persistent) { std::string epubPageNumber_str = std::to_string(mupdf::epubPageNumber); string_writeconfig("/tmp/inkboxPageNumber", epubPageNumber_str); if(persistent == true) { + epubPageNumber_str.append("\n"); string_writeconfig(".config/A-page_number/config", epubPageNumber_str); } }