From 70f55d0ebcd67fb64c24450170b88386c2c70494 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 7 Dec 2015 03:21:35 +0100 Subject: [PATCH] Fix compilation and a couple of warnings CCMAIL: holger.k@elberer.de --- plugins/notifications/notificationslistener.cpp | 9 +++++---- plugins/notifications/notificationslistener.h | 2 +- tests/testnotificationlistener.cpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/notifications/notificationslistener.cpp b/plugins/notifications/notificationslistener.cpp index 7e643af3c..c5f956307 100644 --- a/plugins/notifications/notificationslistener.cpp +++ b/plugins/notifications/notificationslistener.cpp @@ -125,11 +125,12 @@ uint NotificationsListener::Notify(const QString &appName, uint replacesId, return 0; int urgency = -1; - bool ok; - if (hints.contains("urgency")) + if (hints.contains("urgency")) { + bool ok; urgency = hints["urgency"].toInt(&ok); - if (!ok) - urgency = -1; + if (!ok) + urgency = -1; + } if (urgency > -1 && urgency < mPlugin->config()->get("generalUrgency", 0)) return 0; diff --git a/plugins/notifications/notificationslistener.h b/plugins/notifications/notificationslistener.h index b3d2b4604..dfa37b8a9 100644 --- a/plugins/notifications/notificationslistener.h +++ b/plugins/notifications/notificationslistener.h @@ -24,7 +24,7 @@ class KdeConnectPlugin; class NotificationsDbusInterface; class Notification; -class NotifyingApplication; +struct NotifyingApplication; class NotificationsListener : public QDBusAbstractAdaptor { diff --git a/tests/testnotificationlistener.cpp b/tests/testnotificationlistener.cpp index 6219d2779..b80d8645d 100644 --- a/tests/testnotificationlistener.cpp +++ b/tests/testnotificationlistener.cpp @@ -141,7 +141,7 @@ void TestNotificationListener::testNotify() plugin->config()->set("generalUrgency", 0); QCOMPARE(plugin->config()->get("generalPersistent"), false); QCOMPARE(plugin->config()->get("generalIncludeBody"), true); - QCOMPARE(plugin->config()->get("generalUrgency"), 0); + QCOMPARE(plugin->config()->get("generalUrgency"), false); // applications are modified directly: listener->getApplications().clear();