Introduce a notification type and add extra notifications for KNotify
[quassel.git] / src / qtui / qtui.cpp
index 4623142..8a38005 100644 (file)
@@ -109,10 +109,10 @@ const QList<AbstractNotificationBackend *> &QtUi::notificationBackends() {
   return _notificationBackends;
 }
 
-uint QtUi::invokeNotification(BufferId bufId, const QString &sender, const QString &text) {
+uint QtUi::invokeNotification(BufferId bufId, AbstractNotificationBackend::NotificationType type, const QString &sender, const QString &text) {
   static int notificationId = 0;
   //notificationId++;
-  AbstractNotificationBackend::Notification notification(++notificationId, bufId, sender, text);
+  AbstractNotificationBackend::Notification notification(++notificationId, bufId, type, sender, text);
   _notifications.append(notification);
   foreach(AbstractNotificationBackend *backend, _notificationBackends)
     backend->notify(notification);
@@ -127,9 +127,7 @@ void QtUi::closeNotification(uint notificationId) {
         backend->close(notificationId);
       i = _notifications.erase(i);
       break;
-    } else {
-      ++i;
-    }
+    } else ++i;
   }
 }
 
@@ -140,9 +138,7 @@ void QtUi::closeNotifications(BufferId bufferId) {
       foreach(AbstractNotificationBackend *backend, _notificationBackends)
         backend->close((*i).notificationId);
       i = _notifications.erase(i);
-    } else {
-      ++i;
-    }
+    } else ++i;
   }
 }
 
@@ -160,7 +156,7 @@ void QtUi::notificationActivated(uint notificationId) {
           Client::bufferModel()->switchToBuffer(bufId);
         _notifications.erase(i);
         break;
-      }
+      } else ++i;
     }
   }