From b5a587cd6e8c9baabb8a94ada33eaddc07f3c408 Mon Sep 17 00:00:00 2001 From: APTX Date: Thu, 18 Apr 2013 14:41:43 +0200 Subject: [PATCH] Proper database check. --- localmylist/mylist.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/localmylist/mylist.cpp b/localmylist/mylist.cpp index f794c3d..854bc43 100644 --- a/localmylist/mylist.cpp +++ b/localmylist/mylist.cpp @@ -80,8 +80,10 @@ Database *MyList::database() const { if (QThread::currentThread() == thread()) return db; - // FIXME figure work thread case - return workThread->database(); + // QThread is in the thread that created it. + if (QThread::currentThread() == workThread->database()->thread()) + return workThread->database(); + return 0; } Settings *MyList::settings() const -- 2.52.0