mirror of
https://github.com/Quill-OS/quill.git
synced 2024-10-31 21:33:22 -07:00
writeconfig_pagenumber: Save PDFs page number, too
This commit is contained in:
parent
6b8875272f
commit
f4141a4494
1 changed files with 17 additions and 9 deletions
26
reader.cpp
26
reader.cpp
|
@ -1511,15 +1511,7 @@ void reader::on_sizeSlider_valueChanged(int value)
|
|||
|
||||
void reader::writeconfig_pagenumber(bool persistent) {
|
||||
// Saving the page number in tmpfs and in persistent storage if requested
|
||||
if(is_epub != true) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(is_epub == true) {
|
||||
std::string epubPageNumber_str = std::to_string(mupdf::epub::epubPageNumber);
|
||||
string_writeconfig("/tmp/inkboxPageNumber", epubPageNumber_str);
|
||||
if(persistent == true) {
|
||||
|
@ -1527,6 +1519,22 @@ void reader::writeconfig_pagenumber(bool persistent) {
|
|||
string_writeconfig(".config/A-page_number/config", epubPageNumber_str);
|
||||
}
|
||||
}
|
||||
else if(is_pdf == true) {
|
||||
std::string pdfPageNumber_str = std::to_string(mupdf::pdf::pdfPageNumber);
|
||||
string_writeconfig("/tmp/inkboxPageNumber", pdfPageNumber_str);
|
||||
if(persistent == true) {
|
||||
pdfPageNumber_str.append("\n");
|
||||
string_writeconfig(".config/A-page_number/config", pdfPageNumber_str);
|
||||
}
|
||||
}
|
||||
else {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void reader::quit_restart() {
|
||||
|
|
Loading…
Reference in a new issue