Revert "Thread ping pong"

This commit is contained in:
Luis Ángel San Martín
2019-09-24 12:00:21 +02:00
committed by GitHub
parent b906bf964f
commit 0b83764734
4 changed files with 35 additions and 70 deletions

View File

@ -53,21 +53,23 @@ void ComicControllerV2::service(HttpRequest &request, HttpResponse &response)
Comic *comicFile = FactoryComic::newComic(libraries.getPath(libraryId) + comic.path);
if (comicFile != NULL) {
QThread *thread = new QThread();
if (comicFile != nullptr) {
QThread *thread = nullptr;
thread = new QThread();
comicFile->moveToThread(thread);
//connect(comicFile, SIGNAL(errorOpening()), thread, SLOT(quit()));
//connect(comicFile, SIGNAL(errorOpening(QString)), thread, SLOT(quit()));
//connect(comicFile, SIGNAL(imagesLoaded()), thread, SLOT(quit()));
connect(comicFile, SIGNAL(destroyed()), thread, SLOT(quit()));
connect(comicFile, SIGNAL(errorOpening()), thread, SLOT(quit()));
connect(comicFile, SIGNAL(errorOpening(QString)), thread, SLOT(quit()));
connect(comicFile, SIGNAL(imagesLoaded()), thread, SLOT(quit()));
connect(thread, SIGNAL(started()), comicFile, SLOT(process()));
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
comicFile->load(libraries.getPath(libraryId) + comic.path);
thread->start();
if (thread != nullptr)
thread->start();
if (remoteComic) {
QLOG_TRACE() << "remote comic requested";