From aea46dc42a33706a49ddaa2af2ad66b648524728 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Mon, 13 Jan 2014 11:30:32 +0100 Subject: [PATCH] a real fix --- src/core/notification/notification.cpp | 1 - src/core/notification/notification.h | 1 + src/core/plugins/snorefrontend.cpp | 7 +--- src/core/plugins/snorefrontend.h | 1 - src/core/snore_p.cpp | 9 +++-- .../freedesktopnotificationfrontend.cpp | 5 ++- .../frontends/snarlnetwork/snarlnetwork.cpp | 34 ++++++++----------- 7 files changed, 24 insertions(+), 34 deletions(-) diff --git a/src/core/notification/notification.cpp b/src/core/notification/notification.cpp index bbb848d..5426566 100644 --- a/src/core/notification/notification.cpp +++ b/src/core/notification/notification.cpp @@ -214,7 +214,6 @@ void Notification::setDefaultTimeout(int defaultTimeout) m_defaultTimeout = defaultTimeout; } - QDataStream &operator<< ( QDataStream &stream, const Notification ¬i ) { stream << "Title: " << noti.title() << " Text: " << noti.text() << " ID: " << noti.id() ; diff --git a/src/core/notification/notification.h b/src/core/notification/notification.h index b95ea4f..4d5991a 100644 --- a/src/core/notification/notification.h +++ b/src/core/notification/notification.h @@ -98,6 +98,7 @@ public: static void setDefaultTimeout(int defaultTimeout); private: + Notification(const QString &,const QString &,const QString &,const QString &,const Icon &,int, NotificationEnums::Prioritys::prioritys ); QExplicitlySharedDataPointer d; static int m_defaultTimeout; diff --git a/src/core/plugins/snorefrontend.cpp b/src/core/plugins/snorefrontend.cpp index 99b1f6d..da5b9b0 100644 --- a/src/core/plugins/snorefrontend.cpp +++ b/src/core/plugins/snorefrontend.cpp @@ -39,11 +39,6 @@ SnoreFrontend::~SnoreFrontend() bool SnoreFrontend::init( SnoreCore *snore ) { - if(!SnorePlugin::init(snore)) - { - return false; - } - connect(snore, SIGNAL(notificationClosed(Snore::Notification)), this, SLOT(notificationClosed(Snore::Notification))); - return true; + return SnorePlugin::init(snore); } } diff --git a/src/core/plugins/snorefrontend.h b/src/core/plugins/snorefrontend.h index 99f7f2e..a4c5e1a 100644 --- a/src/core/plugins/snorefrontend.h +++ b/src/core/plugins/snorefrontend.h @@ -41,7 +41,6 @@ public: virtual ~SnoreFrontend(); virtual bool init(SnoreCore *snore); -public slots: virtual void actionInvoked( Snore::Notification notification )=0; virtual void notificationClosed( Snore::Notification notification )=0; }; diff --git a/src/core/snore_p.cpp b/src/core/snore_p.cpp index ada590f..1d0f7c3 100644 --- a/src/core/snore_p.cpp +++ b/src/core/snore_p.cpp @@ -63,10 +63,9 @@ void SnoreCorePrivate::notificationActionInvoked(Notification notification) cons { Q_Q(const SnoreCore); emit const_cast(q)->actionInvoked(notification); - SnoreFrontend *nf = notification.source(); - if ( nf != NULL ) + if ( notification.source() ) { - nf->actionInvoked ( notification ); + notification.source()->actionInvoked ( notification ); } } @@ -74,5 +73,9 @@ void SnoreCorePrivate::slotNotificationClosed(Notification n) { Q_Q(SnoreCore); emit q->notificationClosed(n); + if(n.source()) + { + n.source()->notificationClosed(n); + } } diff --git a/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.cpp b/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.cpp index dfe3c7f..de78962 100644 --- a/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.cpp +++ b/src/plugins/frontends/freedesktop/freedesktopnotificationfrontend.cpp @@ -62,9 +62,8 @@ void FreedesktopFrontend::actionInvoked(Notification notification) { } } -void FreedesktopFrontend::notificationClosed(Notification notification) { - - qDebug()<<"Closing Dbus notification"<