fixed comiccontroller, now ComicFiles are loaded in a background thread (7z.dll)

fixed local comunications, no more read/write locks
This commit is contained in:
Luis Ángel San Martín
2013-08-11 22:20:38 +02:00
parent 19fcc5b826
commit 9b2b9d2b8b
4 changed files with 56 additions and 24 deletions

View File

@ -50,16 +50,13 @@ void ComicController::service(HttpRequest& request, HttpResponse& response)
if(comicFile != NULL)
{
QThread * thread = NULL;
if (typeid(*comicFile) != typeid(FileComic))
{
thread = new QThread();
comicFile->moveToThread(thread);
thread = new QThread();
connect(thread, SIGNAL(started()), comicFile, SLOT(process()));
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
comicFile->moveToThread(thread);
}
connect(thread, SIGNAL(started()), comicFile, SLOT(process()));
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
comicFile->load(libraries.value(libraryName)+comic.path);