Properly clean up scopes when deregistering a subscriber.
ClosedPublic

Authored by dfaure on Feb 2 2019, 3:18 PM.

Details

Summary

It was done "by hand", for only a few setters; use apply() to do this
consistently for all of them.

New unittest notificationmanagertest
This requires adding a special mode for unittests in AkThread, to be
able to call methods in NotificationManager from the main thread.

Test Plan

bin/notificationmanagertest

Diff Detail

Repository
R165 Akonadi
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dfaure requested review of this revision.Feb 2 2019, 3:18 PM
dfaure created this revision.
dvratil requested changes to this revision.Feb 2 2019, 5:02 PM

Looks good, just one small change regarding the thread/no-thread handling.

src/server/notificationmanager.cpp
56

Probably would be safer to move the`if` into AkThread::quitThread() and make it a no-op if startMode is NoThread.

This revision now requires changes to proceed.Feb 2 2019, 5:02 PM
dfaure added inline comments.Feb 2 2019, 5:12 PM
src/server/notificationmanager.cpp
56

Yeah, I thought about that. I didn't do it because it requires making startMode a member variable there, but indeed this seems like the cleanest solution, I'll do that.

dfaure updated this revision to Diff 50732.Feb 2 2019, 5:22 PM

Add m_startMode to AkThread to make quitThread() a no-op if NoThread.

Restricted Application added a project: KDE PIM. · View Herald TranscriptFeb 2 2019, 5:22 PM
dvratil accepted this revision.Feb 5 2019, 12:01 PM

Thanks!

This revision is now accepted and ready to land.Feb 5 2019, 12:01 PM
This revision was automatically updated to reflect the committed changes.