diff --git a/src/plugins/backends/freedesktop/freedesktopnotification_backend.cpp b/src/plugins/backends/freedesktop/freedesktopnotification_backend.cpp index 4117916..f4bb966 100644 --- a/src/plugins/backends/freedesktop/freedesktopnotification_backend.cpp +++ b/src/plugins/backends/freedesktop/freedesktopnotification_backend.cpp @@ -3,6 +3,8 @@ #include #include #include "core/notification/notification.h" +#include "core/notification/notification_p.h" +#include "core/snore_p.h" #include #include #include "fredesktopnotification.h" @@ -34,16 +36,6 @@ bool FreedesktopBackend::init(SnoreCore *snore){ return SnoreBackend::init(snore); } -void FreedesktopBackend::slotRegisterApplication ( Application *application ) -{ - Q_UNUSED ( application ); -} - -void FreedesktopBackend::slotUnregisterApplication ( Application *application ) -{ - Q_UNUSED ( application ); -} - void FreedesktopBackend::slotNotify ( Notification noti ) { QStringList actions; @@ -51,10 +43,6 @@ void FreedesktopBackend::slotNotify ( Notification noti ) { actions << QString::number(k) << noti.actions()[k]->name; } - - - - QVariantMap hints; if(noti.icon().isValid()) { @@ -66,7 +54,7 @@ void FreedesktopBackend::slotNotify ( Notification noti ) { hints["urgency"] = (char)noti.priority()+1; } - + qDebug() << "hints" << hints; uint updateId = 0; if(noti.updateID() != 0) @@ -96,15 +84,19 @@ void FreedesktopBackend::slotNotify ( Notification noti ) void FreedesktopBackend::slotActionInvoked(const uint &id, const QString &actionID){ Notification noti = getActiveNotificationByID(m_dbusIdMap[id]); if(!noti.isValid()) + { return; - noti.setActionInvoked ( actionID.toInt() ); - snore()->notificationActionInvoked ( noti ); + } + noti.data()->setActionInvoked ( actionID.toInt() ); + snore()->d()->notificationActionInvoked ( noti ); } void FreedesktopBackend::slotCloseNotification ( Notification notification ) { if(!m_snoreIdMap.contains(notification.id())) + { return; + } uint id = m_snoreIdMap.take(notification.id()); m_dbusIdMap.remove(id); m_interface->CloseNotification(id); diff --git a/src/plugins/backends/freedesktop/freedesktopnotification_backend.h b/src/plugins/backends/freedesktop/freedesktopnotification_backend.h index 901f701..06b087d 100644 --- a/src/plugins/backends/freedesktop/freedesktopnotification_backend.h +++ b/src/plugins/backends/freedesktop/freedesktopnotification_backend.h @@ -15,8 +15,6 @@ public: public slots: void slotNotify( Snore::Notification notification ); void slotCloseNotification ( Snore::Notification notification ); - void slotRegisterApplication ( Snore::Application *application ); - void slotUnregisterApplication ( Snore::Application *application ); void slotActionInvoked(const uint &id,const QString &actionID); void slotNotificationClosed ( const uint &id,const uint &reason );