From f813a018d2145a33d97f7b2950747b378b2ee7d3 Mon Sep 17 00:00:00 2001 From: Felix Kauselmann Date: Thu, 3 Jun 2021 14:20:32 +0200 Subject: [PATCH] Comic: Virtual prototype for process(), fix signal/slot --- YACReader/render.cpp | 2 +- YACReaderLibrary/server/controllers/v1/comiccontroller.cpp | 2 +- YACReaderLibrary/server/controllers/v2/comiccontroller_v2.cpp | 2 +- .../server/controllers/v2/comiccontrollerinreadinglist_v2.cpp | 2 +- common/comic.h | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/YACReader/render.cpp b/YACReader/render.cpp index 459bc6de..69f06b78 100644 --- a/YACReader/render.cpp +++ b/YACReader/render.cpp @@ -751,7 +751,7 @@ void Render::startLoad() connect(comic, &Comic::imagesLoaded, thread, &QThread::quit, Qt::QueuedConnection); connect(comic, SIGNAL(destroyed()), thread, SLOT(quit()), Qt::QueuedConnection); connect(comic, &Comic::invalidated, thread, &QThread::quit, Qt::QueuedConnection); - connect(thread, SIGNAL(started()), comic, SLOT(process())); + connect(thread, &QThread::started, comic, &Comic::process); connect(thread, &QThread::finished, thread, &QObject::deleteLater); if (thread != nullptr) diff --git a/YACReaderLibrary/server/controllers/v1/comiccontroller.cpp b/YACReaderLibrary/server/controllers/v1/comiccontroller.cpp index d525d755..3fb5f8b3 100644 --- a/YACReaderLibrary/server/controllers/v1/comiccontroller.cpp +++ b/YACReaderLibrary/server/controllers/v1/comiccontroller.cpp @@ -64,7 +64,7 @@ void ComicController::service(HttpRequest &request, HttpResponse &response) connect(comicFile, SIGNAL(errorOpening()), thread, SLOT(quit())); connect(comicFile, SIGNAL(errorOpening(QString)), thread, SLOT(quit())); connect(comicFile, &Comic::imagesLoaded, thread, &QThread::quit); - connect(thread, SIGNAL(started()), comicFile, SLOT(process())); + connect(thread, &QThread::started, comicFile, &Comic::process); connect(thread, &QThread::finished, thread, &QObject::deleteLater); comicFile->load(libraries.getPath(libraryId) + comic.path); diff --git a/YACReaderLibrary/server/controllers/v2/comiccontroller_v2.cpp b/YACReaderLibrary/server/controllers/v2/comiccontroller_v2.cpp index 232e6db1..3440b0ea 100644 --- a/YACReaderLibrary/server/controllers/v2/comiccontroller_v2.cpp +++ b/YACReaderLibrary/server/controllers/v2/comiccontroller_v2.cpp @@ -69,7 +69,7 @@ void ComicControllerV2::service(HttpRequest &request, HttpResponse &response) connect(comicFile, SIGNAL(errorOpening()), thread, SLOT(quit())); connect(comicFile, SIGNAL(errorOpening(QString)), thread, SLOT(quit())); connect(comicFile, &Comic::imagesLoaded, thread, &QThread::quit); - connect(thread, SIGNAL(started()), comicFile, SLOT(process())); + connect(thread, &QThread::started, comicFile, &Comic::process); connect(thread, &QThread::finished, thread, &QObject::deleteLater); comicFile->load(libraries.getPath(libraryId) + comic.path); diff --git a/YACReaderLibrary/server/controllers/v2/comiccontrollerinreadinglist_v2.cpp b/YACReaderLibrary/server/controllers/v2/comiccontrollerinreadinglist_v2.cpp index a6f520f6..9cd697e1 100644 --- a/YACReaderLibrary/server/controllers/v2/comiccontrollerinreadinglist_v2.cpp +++ b/YACReaderLibrary/server/controllers/v2/comiccontrollerinreadinglist_v2.cpp @@ -56,7 +56,7 @@ void ComicControllerInReadingListV2::service(HttpRequest &request, HttpResponse connect(comicFile, SIGNAL(errorOpening()), thread, SLOT(quit())); connect(comicFile, SIGNAL(errorOpening(QString)), thread, SLOT(quit())); connect(comicFile, &Comic::imagesLoaded, thread, &QThread::quit); - connect(thread, SIGNAL(started()), comicFile, SLOT(process())); + connect(thread, &QThread::started, comicFile, &Comic::process); connect(thread, &QThread::finished, thread, &QObject::deleteLater); comicFile->load(libraries.getPath(libraryId) + comic.path); diff --git a/common/comic.h b/common/comic.h index 3174746a..e6240565 100644 --- a/common/comic.h +++ b/common/comic.h @@ -92,6 +92,7 @@ public slots: void updateBookmarkImage(int); void setPageLoaded(int page); void invalidate(); + virtual void process() {}; signals: void invalidated();