From 9321d864dbd3b366387c2ca3c4125e943a73b30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Sat, 6 Oct 2018 11:12:44 +0200 Subject: [PATCH] Fixed sending read progress. --- YACReader/main_window_viewer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/YACReader/main_window_viewer.cpp b/YACReader/main_window_viewer.cpp index 87f35f4f..b4b2bbe7 100644 --- a/YACReader/main_window_viewer.cpp +++ b/YACReader/main_window_viewer.cpp @@ -1683,21 +1683,21 @@ void MainWindowViewer::sendComic() { YACReaderLocalClient * client = new YACReaderLocalClient; - connect(client, &YACReaderLocalClient::finished, client, &YACReaderLocalClient::deleteLater); + connect(client, &YACReaderLocalClient::finished, client, &YACReaderLocalClient::deleteLater); currentComicDB.info.lastTimeOpened = QDateTime::currentMSecsSinceEpoch() / 1000; viewer->updateComic(currentComicDB); - if (currentComicDB.info.currentPage == currentComicDB.info.numPages) { - int currentIndex = siblingComics.indexOf(currentComicDB); - if(currentIndex+1 > 0 && currentIndex+1 < siblingComics.count()) - { + int currentIndex = siblingComics.indexOf(currentComicDB); + bool sendNextComicInfo = (currentComicDB.info.currentPage == currentComicDB.info.numPages) + && (currentIndex+1 > 0 && currentIndex+1 < siblingComics.count()); + + if (sendNextComicInfo) { ComicDB & nextComic = siblingComics[currentIndex+1]; nextComic.info.hasBeenOpened = true; int retries = 1; while(!client->sendComicInfo(libraryId, currentComicDB, nextComic.id) && retries!=0) retries--; - } } else { int retries = 1; while(!client->sendComicInfo(libraryId, currentComicDB) && retries!=0)