QueryService: Decouple the SearchRunnables and the Folder class
Review Request #108271 - Created Jan. 8, 2013 and submitted
The SearchRunnable classes used to contain a reference to the Folder and call certain functions on it. Since the SearchRunnables were in another thread this required mutexes and still often resulted in deadlocks and crashes. The new code uses signals and slots to communicate between the Folder and the SearchRunnable classes. This is a lot more elegant and easier to understand. As far as I see the m_runnableMutex is no longer required. Could someone confirm? Or should I just let it be?
Basic functionality testing done. It's a little hard to test the multi-threading part of it.
Looks good, and makes the code much simpler and more elegant. I agree that you don't need m_runnableMutex anymore, because the slots will now be executed in the same thread as the folder, instead of the QRunnable's thread, right? So all methods of Folder live in a single-thread, and the mutex doesn't do anything anymore. So yes, I vote for ditching it.