From 7727d37a67a257eca7b580efd2dc2fe0ea4b1df8 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Thu, 11 Aug 2011 05:14:09 -0700 Subject: [PATCH] fixed a crash --- .../freedesktopnotification_backend.cpp | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) 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()