Event backend porting
[quassel.git] / src / qtui / statusnotifieritem.cpp
index 791bd28..ce3d3d8 100644 (file)
@@ -5,10 +5,10 @@
  *   This contains code from KStatusNotifierItem, part of the KDE libs     *
  *   Copyright (C) 2009 Marco Martin <notmart@gmail.com>                   *
  *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) version 3.                                           *
+ *   This file is free software; you can redistribute it and/or modify     *
+ *   it under the terms of the GNU Library General Public License (LGPL)   *
+ *   as published by the Free Software Foundation; either version 2 of the *
+ *   License, or (at your option) any later version.                       *
  *                                                                         *
  *   This program is distributed in the hope that it will be useful,       *
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
@@ -105,6 +105,7 @@ void StatusNotifierItem::init() {
   if(_notificationsClient->isValid()) {
     QStringList desktopCapabilities = _notificationsClient->GetCapabilities();
     _notificationsClientSupportsMarkup = desktopCapabilities.contains("body-markup");
+    _notificationsClientSupportsActions = desktopCapabilities.contains("actions");
   }
 
   StatusNotifierItemParent::init();
@@ -274,7 +275,9 @@ void StatusNotifierItem::showMessage(const QString &title, const QString &messag
     if(_notificationsClientSupportsMarkup)
       message = Qt::escape(message);
 
-    QStringList actions = QStringList() << "activate" << "View";
+    QStringList actions;
+    if(_notificationsClientSupportsActions)
+      actions << "activate" << "View";
 
     // we always queue notifications right now
     QDBusReply<uint> reply = _notificationsClient->Notify(title, 0, "quassel", title, message, actions, QVariantMap(), timeout);