]> Some of my projects - localmylist.git/commitdiff
Proper database check.
authorAPTX <marek321@gmail.com>
Thu, 18 Apr 2013 12:41:43 +0000 (14:41 +0200)
committerAPTX <marek321@gmail.com>
Thu, 18 Apr 2013 12:41:43 +0000 (14:41 +0200)
localmylist/mylist.cpp

index f794c3de0c979872a7904bee11654febd4f0d7c1..854bc43b011fe3c820a9bf063fddefb6fb55fcdd 100644 (file)
@@ -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