diff --git a/src/plugins/freedesktopnotification/freedesktopnotification_backend.cpp b/src/plugins/freedesktopnotification/freedesktopnotification_backend.cpp index 2c8e41a..6b028e5 100644 --- a/src/plugins/freedesktopnotification/freedesktopnotification_backend.cpp +++ b/src/plugins/freedesktopnotification/freedesktopnotification_backend.cpp @@ -69,9 +69,13 @@ uint FreedesktopNotification_Backend::notify ( Notification noti ) message.setArguments(args); QDBusMessage replyMsg = QDBusConnection::sessionBus().call(message); - uint id = replyMsg.arguments().last().toInt(); - activeNotifications[id] = noti; - startTimeout(id,noti.timeout()); + uint id ; + if(replyMsg.type() == QDBusMessage::ReplyMessage){ + id= replyMsg.arguments().at(0).toUInt(); + qDebug()<<"DBUS_ID"<notificationActionInvoked ( noti ); - snore()->closeNotification(noti,NotificationEnums::CloseReasons::CLOSED); - } void FreedesktopNotification_Backend::closeNotification ( Notification notification ) @@ -94,21 +96,14 @@ void FreedesktopNotification_Backend::closeNotification ( Notification notificat } -//QString fNotification::vendor ( "" ); - - - void FreedesktopNotification_Backend::closed ( const uint &id,const uint &reason ) { - Notification noti = activeNotifications[id]; qDebug() <<"Closed"<closeNotification ( noti ,r); + if(id == 0) + return; + Notification noti = activeNotifications.take(id); + snore()->closeNotification ( noti ,QFlag(reason)); } //QString fNotification::getVendor()