replace custom qevents with simple signal/slots (part2)
Review Request #126501 - Created Dec. 24, 2015 and submitted
Remove also the other custom QEvents with signal/slots.
This also fixes the memleaks in the QEvent handling code.
Removing the now superflous files will be done later.
I checked it with valgrind - no more memleaks
Currently I could only test the codepath for contextGetLogin()/contextGetSavedLogin()/contextNotify(QString) but the others are straight-forward...
"using CContextListener::contextNotify;" would work too
This call to wait() could happen after the main thread calls wakeAll(), in theory.
And then the notification is lost (that's how wait conditions work), and wait() will wait forever.
A wait condition is unsuitable for this use case.
Instead a semaphore could be used (then it works both ways, whichever happens first, the waiting or the waking).
Or for this particular use case, waiting for the slot to be executed, you could just use BlockingQueuedConnection in the connect() statement. Then synchronization is done by Qt and you can remove the wait condition and its associated mutex.
should use QMutexLocker
Use Qt::BlockingQueuedConnection instead QMutex/QWaitCondition to avoid possible deadlocks. This also results in a cleaner codebase.
Revision 2 (+186 -307)