From: APTX Date: Thu, 18 Apr 2013 12:41:43 +0000 (+0200) Subject: Proper database check. X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=b5a587cd6e8c9baabb8a94ada33eaddc07f3c408;p=localmylist.git Proper database check. --- 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