Complete and pimp DesktopNotificationBackend.
[quassel.git] / src / qtui / qtui.cpp
index 3072767..8cb8347 100644 (file)
@@ -32,7 +32,7 @@
 
 ActionCollection *QtUi::_actionCollection = 0;
 MainWin *QtUi::_mainWin = 0;
-QSet<AbstractNotificationBackend *> QtUi::_notificationBackends;
+QList<AbstractNotificationBackend *> QtUi::_notificationBackends;
 QList<AbstractNotificationBackend::Notification> QtUi::_notifications;
 QtUiStyle *QtUi::_style = 0;
 
@@ -81,19 +81,19 @@ void QtUi::disconnectedFromCore() {
 
 void QtUi::registerNotificationBackend(AbstractNotificationBackend *backend) {
   if(!_notificationBackends.contains(backend)) {
-    _notificationBackends.insert(backend);
+    _notificationBackends.append(backend);
   }
 }
 
 void QtUi::unregisterNotificationBackend(AbstractNotificationBackend *backend) {
-  _notificationBackends.remove(backend);
+  _notificationBackends.removeAll(backend);
 }
 
 void QtUi::unregisterAllNotificationBackends() {
   _notificationBackends.clear();
 }
 
-const QSet<AbstractNotificationBackend *> &QtUi::notificationBackends() {
+const QList<AbstractNotificationBackend *> &QtUi::notificationBackends() {
   return _notificationBackends;
 }
 
@@ -123,7 +123,7 @@ void QtUi::closeNotification(uint notificationId) {
 void QtUi::closeNotifications(BufferId bufferId) {
   QList<AbstractNotificationBackend::Notification>::iterator i = _notifications.begin();
   while(i != _notifications.end()) {
-    if((*i).bufferId == bufferId) {
+    if(!bufferId.isValid() || (*i).bufferId == bufferId) {
       foreach(AbstractNotificationBackend *backend, _notificationBackends)
         backend->close((*i).notificationId);
       _notifications.erase(i);