Added comment.

This commit is contained in:
Martin Rotter 2016-03-05 10:29:01 +01:00
parent f42c82503f
commit 89c4738245
2 changed files with 11 additions and 6 deletions

View File

@ -50,11 +50,16 @@ Notification::Notification() : QWidget(0), m_title(QString()), m_text(QString())
QDBusConnection::sessionBus(), this); QDBusConnection::sessionBus(), this);
if (m_dBusInterface->isValid()) { if (m_dBusInterface->isValid()) {
m_dBusInterface->connection().connect("org.freedesktop.Notifications", QDBusConnection conn = m_dBusInterface->connection();
"/org/freedesktop/Notifications",
"org.freedesktop.Notifications", if (!conn.connect("org.freedesktop.Notifications",
"NotificationClosed", "/org/freedesktop/Notifications",
this, SLOT(notificationClosed(uint,uint))); "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 #endif

View File

@ -52,7 +52,7 @@ class Notification : public QWidget {
void loadSettings(); void loadSettings();
#if defined(Q_OS_LINUX) #if defined(Q_OS_LINUX)
private slots: public slots:
void notificationClosed(uint id, uint reason); void notificationClosed(uint id, uint reason);
#endif #endif