From 89c4738245bad1e221bd83a096963b557545a0f5 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Sat, 5 Mar 2016 10:29:01 +0100 Subject: [PATCH] Added comment. --- src/gui/notifications/notification.cpp | 15 ++++++++++----- src/gui/notifications/notification.h | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gui/notifications/notification.cpp b/src/gui/notifications/notification.cpp index 6552b8ab3..dcf297b2b 100755 --- a/src/gui/notifications/notification.cpp +++ b/src/gui/notifications/notification.cpp @@ -50,11 +50,16 @@ Notification::Notification() : QWidget(0), m_title(QString()), m_text(QString()) QDBusConnection::sessionBus(), this); if (m_dBusInterface->isValid()) { - m_dBusInterface->connection().connect("org.freedesktop.Notifications", - "/org/freedesktop/Notifications", - "org.freedesktop.Notifications", - "NotificationClosed", - this, SLOT(notificationClosed(uint,uint))); + QDBusConnection conn = m_dBusInterface->connection(); + + if (!conn.connect("org.freedesktop.Notifications", + "/org/freedesktop/Notifications", + "org.freedesktop.Notifications", + "NotificationClosed", + this, SLOT(notificationClosed(uint,uint)))) { + qWarning("Failed to connec notifications to 'NotificationClosed' signal, last error: '%s'.", + qPrintable(conn.lastError().name())); + } } #endif diff --git a/src/gui/notifications/notification.h b/src/gui/notifications/notification.h index 9b84cc1a7..03de73b3f 100755 --- a/src/gui/notifications/notification.h +++ b/src/gui/notifications/notification.h @@ -52,7 +52,7 @@ class Notification : public QWidget { void loadSettings(); #if defined(Q_OS_LINUX) - private slots: + public slots: void notificationClosed(uint id, uint reason); #endif