[app] Set target thread for HashTask

This commit is contained in:
Slava Monich 2018-05-17 20:15:29 +03:00
parent 6c62bad2a7
commit cfcb0b7fbc
2 changed files with 5 additions and 6 deletions

View file

@ -300,7 +300,7 @@ void BooksBook::GuessCoverTask::performTask()
class BooksBook::HashTask : public HarbourTask
{
public:
HashTask(QThreadPool* aPool, QString aPath);
HashTask(QThreadPool* aPool, QThread* aTargetThread, QString aPath);
virtual void performTask();
@ -309,8 +309,8 @@ public:
QByteArray iHash;
};
BooksBook::HashTask::HashTask(QThreadPool* aPool, QString aPath) :
HarbourTask(aPool), iPath(aPath)
BooksBook::HashTask::HashTask(QThreadPool* aPool, QThread* aTargetThread,
QString aPath) : HarbourTask(aPool, aTargetThread), iPath(aPath)
{
}
@ -390,8 +390,7 @@ BooksBook::BooksBook(const BooksStorage& aStorage, QString aRelativePath,
if (iHash.isEmpty()) {
HDEBUG("need to calculate hash for" << qPrintable(iPath));
iHashTaskQueue = BooksTaskQueue::hashQueue();
iHashTask = new HashTask(iHashTaskQueue->pool(), iPath);
iHashTask->moveToThread(thread());
iHashTask = new HashTask(iHashTaskQueue->pool(), thread(), iPath);
iHashTask->submit(this, SLOT(onHashTaskDone()));
}
// Refcounted BooksBook objects are managed by C++ code

@ -1 +1 @@
Subproject commit b0fda2fea0c7381d74bf848902c48cbbcd3f6a8e
Subproject commit 7574d4159407022dff5eb7ccbc805048a8f61b51