[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:29:32 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=548508d
The following commit has been merged in the master branch:
commit 548508d6e61c4c2e7b15763809375b919df089c9
Author: Holger Kaelberer <holger.k at elberer.de>
Date: Tue Jan 5 21:25:07 2016 +0100
notifications: don't register proxied notifications internally
REVIEW: 126645
---
plugins/notifications/notificationslistener.cpp | 3 --
tests/testnotificationlistener.cpp | 46 -------------------------
2 files changed, 49 deletions(-)
diff --git a/plugins/notifications/notificationslistener.cpp b/plugins/notifications/notificationslistener.cpp
index c5f9563..22d50fb 100644
--- a/plugins/notifications/notificationslistener.cpp
+++ b/plugins/notifications/notificationslistener.cpp
@@ -152,9 +152,6 @@ uint NotificationsListener::Notify(const QString &appName, uint replacesId,
// timeout == 0, for other notifications
// clearability is pointless
- Notification *notification = new Notification(np, QString(), this);
- dbusInterface->addNotification(notification);
-
mPlugin->sendPackage(np);
return (replacesId > 0 ? replacesId : id);
diff --git a/tests/testnotificationlistener.cpp b/tests/testnotificationlistener.cpp
index b80d864..e1faa1c 100644
--- a/tests/testnotificationlistener.cpp
+++ b/tests/testnotificationlistener.cpp
@@ -23,11 +23,8 @@
#include <QNetworkAccessManager>
#include <QTest>
#include <QTemporaryFile>
-#include <QSignalSpy>
#include <QStandardPaths>
-#include <KIO/AccessManager>
-
#include "core/daemon.h"
#include "core/device.h"
#include "core/kdeconnectplugin.h"
@@ -45,9 +42,6 @@ public:
explicit TestNotificationsPlugin(QObject *parent, const QVariantList &args)
: NotificationsPlugin(parent, args)
{
- // make notificationPosted() inspectable:
- connect(notificationsDbusInterface, &NotificationsDbusInterface::notificationPosted,
- this, &TestNotificationsPlugin::notificationPosted);
}
virtual ~TestNotificationsPlugin() {};
@@ -67,9 +61,6 @@ public:
{
return notificationsDbusInterface;
}
-
-Q_SIGNALS:
- void notificationPosted(const QString& publicId);
};
// Tweaked NotificationsListener for testing:
@@ -153,16 +144,11 @@ void TestNotificationListener::testNotify()
uint replacesId = 99;
uint retId;
- int notificationId = 0;
- QSignalSpy spy(plugin, &TestNotificationsPlugin::notificationPosted);
// regular Notify call that is synchronized ...
retId = listener->Notify("testApp", replacesId, "some-icon", "summary", "body", {}, {{}}, 0);
// ... should return replacesId,
QCOMPARE(retId, replacesId);
- // ... trigger a notificationPosted signal with incremented id
- QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).toString(), QString::number(++notificationId));
// ... and create a new application internally that is initialized correctly:
QCOMPARE(listener->getApplications().count(), 1);
QVERIFY(listener->getApplications().contains("testApp"));
@@ -175,8 +161,6 @@ void TestNotificationListener::testNotify()
// another one, with other timeout and urgency values:
retId = listener->Notify("testApp2", replacesId+1, "some-icon2", "summary2", "body2", {}, {{"urgency", 2}}, 10);
QCOMPARE(retId, replacesId+1);
- QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).toString(), QString::number(++notificationId));
QCOMPARE(listener->getApplications().count(), 2);
QVERIFY(listener->getApplications().contains("testApp2"));
QVERIFY(listener->getApplications().contains("testApp"));
@@ -185,32 +169,23 @@ void TestNotificationListener::testNotify()
plugin->config()->set("generalPersistent", true);
retId = listener->Notify("testApp", replacesId, "some-icon", "summary", "body", {}, {{}}, 1);
QCOMPARE(retId, 0U);
- QCOMPARE(spy.count(), 0);
retId = listener->Notify("testApp2", replacesId, "some-icon2", "summary2", "body2", {}, {{}}, 3);
QCOMPARE(retId, 0U);
- QCOMPARE(spy.count(), 0);
// but timeout == 0 is
retId = listener->Notify("testApp", replacesId, "some-icon", "summary", "body", {}, {{}}, 0);
QCOMPARE(retId, replacesId);
- QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).toString(), QString::number(++notificationId));
plugin->config()->set("generalPersistent", false);
// if min-urgency is set, lower urgency levels are not synced:
plugin->config()->set("generalUrgency", 1);
retId = listener->Notify("testApp", replacesId, "some-icon", "summary", "body", {}, {{"urgency", 0}}, 0);
QCOMPARE(retId, 0U);
- QCOMPARE(spy.count(), 0);
// equal urgency is
retId = listener->Notify("testApp", replacesId, "some-icon", "summary", "body", {}, {{"urgency", 1}}, 0);
QCOMPARE(retId, replacesId);
- QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).toString(), QString::number(++notificationId));
// higher urgency as well
retId = listener->Notify("testApp", replacesId, "some-icon", "summary", "body", {}, {{"urgency", 2}}, 0);
QCOMPARE(retId, replacesId);
- QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).toString(), QString::number(++notificationId));
plugin->config()->set("generalUrgency", 0);
// notifications for a deactivated application are not synced:
@@ -219,68 +194,47 @@ void TestNotificationListener::testNotify()
QVERIFY(!listener->getApplications()["testApp"].active);
retId = listener->Notify("testApp", replacesId, "some-icon", "summary", "body", {}, {{"urgency", 0}}, 0);
QCOMPARE(retId, 0U);
- QCOMPARE(spy.count(), 0);
// others are still:
retId = listener->Notify("testApp2", replacesId+1, "some-icon2", "summary2", "body2", {}, {{}}, 0);
QCOMPARE(retId, replacesId+1);
- QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).toString(), QString::number(++notificationId));
// back to normal:
listener->getApplications()["testApp"].active = true;
QVERIFY(listener->getApplications()["testApp"].active);
retId = listener->Notify("testApp", replacesId, "some-icon", "summary", "body", {}, {{}}, 0);
QCOMPARE(retId, replacesId);
- QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).toString(), QString::number(++notificationId));
// notifications with blacklisted subjects are not synced:
QVERIFY(listener->getApplications().contains("testApp"));
listener->getApplications()["testApp"].blacklistExpression.setPattern("black[12]|foo(bar|baz)");
retId = listener->Notify("testApp", replacesId, "some-icon", "summary black1", "body", {}, {{}}, 0);
QCOMPARE(retId, 0U);
- QCOMPARE(spy.count(), 0);
retId = listener->Notify("testApp", replacesId, "some-icon", "summary foobar", "body", {}, {{}}, 0);
QCOMPARE(retId, 0U);
- QCOMPARE(spy.count(), 0);
// other subjects are synced:
retId = listener->Notify("testApp", replacesId, "some-icon", "summary foo", "body", {}, {{}}, 0);
QCOMPARE(retId, replacesId);
- QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).toString(), QString::number(++notificationId));
retId = listener->Notify("testApp", replacesId, "some-icon", "summary black3", "body", {}, {{}}, 0);
QCOMPARE(retId, replacesId);
- QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).toString(), QString::number(++notificationId));
// also body is checked by blacklist if requested:
plugin->config()->set("generalIncludeBody", true);
retId = listener->Notify("testApp", replacesId, "some-icon", "summary", "body black1", {}, {{}}, 0);
QCOMPARE(retId, 0U);
- QCOMPARE(spy.count(), 0);
retId = listener->Notify("testApp", replacesId, "some-icon", "summary", "body foobaz", {}, {{}}, 0);
QCOMPARE(retId, 0U);
- QCOMPARE(spy.count(), 0);
// body does not matter if inclusion was not requested:
plugin->config()->set("generalIncludeBody", false);
retId = listener->Notify("testApp", replacesId, "some-icon", "summary", "body black1", {}, {{}}, 0);
QCOMPARE(retId, replacesId);
- QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).toString(), QString::number(++notificationId));
retId = listener->Notify("testApp", replacesId, "some-icon", "summary", "body foobaz", {}, {{}}, 0);
QCOMPARE(retId, replacesId);
- QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).toString(), QString::number(++notificationId));
// back to normal:
listener->getApplications()["testApp"].blacklistExpression.setPattern("");
plugin->config()->set("generalIncludeBody", true);
retId = listener->Notify("testApp", replacesId, "some-icon", "summary", "body", {}, {{}}, 0);
QCOMPARE(retId, replacesId);
- QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).toString(), QString::number(++notificationId));
retId = listener->Notify("testApp2", replacesId, "some-icon2", "summary2", "body2", {}, {{}}, 0);
QCOMPARE(retId, replacesId);
- QCOMPARE(spy.count(), 1);
- QCOMPARE(spy.takeFirst().at(0).toString(), QString::number(++notificationId));
}
--
kdeconnect packaging
More information about the pkg-kde-commits
mailing list