From 2674a1b9c0f32b77bee7ea7f74d8cc12b584d046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Wed, 24 Jul 2013 17:44:38 +0200 Subject: [PATCH] open next/previous after leaving client mode fixed --- YACReader/main_window_viewer.cpp | 33 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/YACReader/main_window_viewer.cpp b/YACReader/main_window_viewer.cpp index 8d9d2aa4..750d082c 100644 --- a/YACReader/main_window_viewer.cpp +++ b/YACReader/main_window_viewer.cpp @@ -615,8 +615,8 @@ void MainWindowViewer::open(QString path, ComicDB & comic, QList & sibl void MainWindowViewer::openComicFromPath(QString pathFile) { - currentDirectory = pathFile; QFileInfo fi(pathFile); + currentDirectory = fi.dir().absolutePath(); getSiblingComics(fi.absolutePath(),fi.fileName()); setWindowTitle("YACReader - " + fi.fileName()); @@ -624,6 +624,8 @@ void MainWindowViewer::openComicFromPath(QString pathFile) enableActions(); viewer->open(pathFile); + + isClient = false; } @@ -634,6 +636,7 @@ void MainWindowViewer::openFolder() if (!pathDir.isEmpty()) { openFolderFromPath(pathDir); + isClient = false; } } @@ -866,16 +869,13 @@ void MainWindowViewer::closeEvent ( QCloseEvent * event ) void MainWindowViewer::openPreviousComic() { YACReaderLocalClient client; - if(!siblingComics.isEmpty()) + if(!siblingComics.isEmpty() && isClient) { - if(isClient) - { - currentComicDB.info.currentPage = viewer->getCurrentPageNumber()+1; - currentComicDB.info.hasBeenOpened = true; - //viewer->getBookmarks(); - client.sendComicInfo(libraryId,currentComicDB); - } + currentComicDB.info.currentPage = viewer->getCurrentPageNumber()+1; + currentComicDB.info.hasBeenOpened = true; + //viewer->getBookmarks(); + client.sendComicInfo(libraryId,currentComicDB); int currentIndex = siblingComics.indexOf(currentComicDB); if (currentIndex == -1) @@ -900,15 +900,12 @@ void MainWindowViewer::openPreviousComic() void MainWindowViewer::openNextComic() { YACReaderLocalClient client; - if(!siblingComics.isEmpty()) + if(!siblingComics.isEmpty() && isClient) { - if(isClient) - { - currentComicDB.info.currentPage = viewer->getCurrentPageNumber()+1; - currentComicDB.info.hasBeenOpened = true; - //viewer->getBookmarks(); - client.sendComicInfo(libraryId,currentComicDB); - } + currentComicDB.info.currentPage = viewer->getCurrentPageNumber()+1; + currentComicDB.info.hasBeenOpened = true; + //viewer->getBookmarks(); + client.sendComicInfo(libraryId,currentComicDB); int currentIndex = siblingComics.indexOf(currentComicDB); if (currentIndex == -1) @@ -999,6 +996,8 @@ void MainWindowViewer::dropEvent(QDropEvent *event) else if(info.isDir()) openFolderFromPath(fName); + + isClient = false; } }