Merge lp://staging/~charlesk/unity-notifications/lp-1470031-ensure-close-notification-signals-are-emitted into lp://staging/unity-notifications

Proposed by Charles Kerr
Status: Merged
Approved by: dobey
Approved revision: 234
Merged at revision: 230
Proposed branch: lp://staging/~charlesk/unity-notifications/lp-1470031-ensure-close-notification-signals-are-emitted
Merge into: lp://staging/unity-notifications
Diff against target: 76 lines (+26/-14)
3 files modified
include/NotificationServer.h (+1/-0)
src/Notification.cpp (+1/-1)
src/NotificationServer.cpp (+24/-13)
To merge this branch: bzr merge lp://staging/~charlesk/unity-notifications/lp-1470031-ensure-close-notification-signals-are-emitted
Reviewer Review Type Date Requested Status
Kyle Fazzari (community) Approve
dobey (community) Approve
Pete Woods Approve
Review via email: mp+263599@code.staging.launchpad.net

Commit message

When a notification is closed due to internals (e.g. due to timeout), ensure the NotificationClosed bus signal is emitted.

Description of the change

The regression comes from the new input sanitizing code in NotificationServer::CloseNotification(), which is a public bus method. The sanity test confirms that the notification exists and is owned by the caller.

However this is also used when a Notification is closed internally due to timeout, and we need to handle the case where the Notification has already been removed from the tables but we need to emit nevertheless.

The solution is to break the input sanitizing code bits and the work bits into two separate methods, so that the implementation can do what it needs to without hitting sanity tests that don't apply to it.

(There is another question of why Notification::~Notification() calls CloseNotification() on itself, but that's an issue for a separate refactor...)

To post a comment you must log in.
Revision history for this message
Pete Woods (pete-woods) :
review: Approve
Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Kyle Fazzari (kyrofa) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: