Fix compilation and a couple of warnings

CCMAIL: holger.k@elberer.de
This commit is contained in:
Aleix Pol 2015-12-07 03:21:35 +01:00
parent 4fc39601dd
commit 70f55d0ebc
3 changed files with 7 additions and 6 deletions

View file

@ -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<int>("generalUrgency", 0))
return 0;

View file

@ -24,7 +24,7 @@
class KdeConnectPlugin;
class NotificationsDbusInterface;
class Notification;
class NotifyingApplication;
struct NotifyingApplication;
class NotificationsListener : public QDBusAbstractAdaptor
{

View file

@ -141,7 +141,7 @@ void TestNotificationListener::testNotify()
plugin->config()->set("generalUrgency", 0);
QCOMPARE(plugin->config()->get<bool>("generalPersistent"), false);
QCOMPARE(plugin->config()->get<bool>("generalIncludeBody"), true);
QCOMPARE(plugin->config()->get<bool>("generalUrgency"), 0);
QCOMPARE(plugin->config()->get<bool>("generalUrgency"), false);
// applications are modified directly:
listener->getApplications().clear();