From 2082fbc09d0accb8270f9fb83fdd2f23c0546333 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Tue, 30 Jan 2018 00:28:11 +0200 Subject: [PATCH] [app] BooksShelf now automatically moves itself to the main thread So does BooksBook --- app/src/BooksShelf.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/BooksShelf.cpp b/app/src/BooksShelf.cpp index 6af1a59..ffd5dc3 100644 --- a/app/src/BooksShelf.cpp +++ b/app/src/BooksShelf.cpp @@ -1,6 +1,6 @@ /* - * Copyright (C) 2015-2017 Jolla Ltd. - * Contact: Slava Monich + * Copyright (C) 2015-2018 Jolla Ltd. + * Copyright (C) 2015-2018 Slava Monich * * You may use this file under the terms of the BSD license as follows: * @@ -184,14 +184,12 @@ void BooksShelf::LoadTask::performTask() } folderPath += info.fileName(); BooksShelf* newShelf = new BooksShelf(iStorage, folderPath); - newShelf->moveToThread(thread()); iItems.append(newShelf); } else { shared_ptr book = BooksUtil::bookFromFile(path); if (!book.isNull()) { BooksBook* newBook = new BooksBook(iStorage, iRelativePath, book); - newBook->moveToThread(thread()); iItems.append(newBook); HDEBUG("[" << iItems.size() << "]" << qPrintable(newBook->fileName()) << @@ -516,6 +514,7 @@ void BooksShelf::init() #if QT_VERSION < 0x050000 setRoleNames(roleNames()); #endif + moveToThread(qApp->thread()); connect(BooksStorageManager::instance(), SIGNAL(storageReplaced(BooksStorage,BooksStorage)), SLOT(onStorageReplaced(BooksStorage,BooksStorage)));