parent
338ddacf14
commit
4cd2862ee5
@ -0,0 +1,28 @@
|
|||||||
|
From 36586dacd06fbd2af89c88aa1ea2ea54790608f4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Kai Uwe Broulik <kde@privat.broulik.de>
|
||||||
|
Date: Sat, 2 Jan 2016 13:33:44 +0100
|
||||||
|
Subject: [PATCH 036/152] [SNI DataEngine] ProtocolVersion is an int
|
||||||
|
|
||||||
|
Obviously.
|
||||||
|
|
||||||
|
REVIEW: 126594
|
||||||
|
---
|
||||||
|
dataengines/statusnotifieritem/statusnotifieritem_engine.cpp | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/dataengines/statusnotifieritem/statusnotifieritem_engine.cpp b/dataengines/statusnotifieritem/statusnotifieritem_engine.cpp
|
||||||
|
index 67c2ec5..08a8c86 100644
|
||||||
|
--- a/dataengines/statusnotifieritem/statusnotifieritem_engine.cpp
|
||||||
|
+++ b/dataengines/statusnotifieritem/statusnotifieritem_engine.cpp
|
||||||
|
@@ -90,7 +90,7 @@ void StatusNotifierItemEngine::registerWatcher(const QString& service)
|
||||||
|
m_statusNotifierWatcher = new org::kde::StatusNotifierWatcher(s_watcherServiceName, QStringLiteral("/StatusNotifierWatcher"),
|
||||||
|
QDBusConnection::sessionBus());
|
||||||
|
if (m_statusNotifierWatcher->isValid() &&
|
||||||
|
- m_statusNotifierWatcher->property("ProtocolVersion").toBool() == s_protocolVersion) {
|
||||||
|
+ m_statusNotifierWatcher->property("ProtocolVersion").toInt() == s_protocolVersion) {
|
||||||
|
connect(m_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierItemRegistered, this, &StatusNotifierItemEngine::serviceRegistered);
|
||||||
|
connect(m_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierItemUnregistered, this, &StatusNotifierItemEngine::serviceUnregistered);
|
||||||
|
|
||||||
|
--
|
||||||
|
2.5.0
|
||||||
|
|
@ -0,0 +1,89 @@
|
|||||||
|
From 49440a7ce0623d1bc8aca459eaed35612d384cfd Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Edmundson <david@davidedmundson.co.uk>
|
||||||
|
Date: Mon, 29 Feb 2016 11:08:24 +0000
|
||||||
|
Subject: [PATCH 127/152] Avoid blocking DBus calls in SNI startup
|
||||||
|
|
||||||
|
All autogenerated qtdbus property fetches are synchronous and not ideal
|
||||||
|
for Plasma to call.
|
||||||
|
|
||||||
|
1) Don't bother checking the protocol version.
|
||||||
|
If the signals are the same, we may as well try and use the old signals,
|
||||||
|
if it's not - the signals won't match anything anyway so it won't do
|
||||||
|
anything anyway.
|
||||||
|
|
||||||
|
2) Replace the blocking RegisteredStatusNotifierItem request with an
|
||||||
|
async variant.
|
||||||
|
|
||||||
|
CCBUG: 359611
|
||||||
|
REVIEW: 127199
|
||||||
|
---
|
||||||
|
dataengines/statusnotifieritem/CMakeLists.txt | 1 +
|
||||||
|
.../statusnotifieritem_engine.cpp | 28 +++++++++++++++-------
|
||||||
|
2 files changed, 21 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/dataengines/statusnotifieritem/CMakeLists.txt b/dataengines/statusnotifieritem/CMakeLists.txt
|
||||||
|
index c28312e..2e93583 100644
|
||||||
|
--- a/dataengines/statusnotifieritem/CMakeLists.txt
|
||||||
|
+++ b/dataengines/statusnotifieritem/CMakeLists.txt
|
||||||
|
@@ -17,6 +17,7 @@ set(statusnotifieritem_engine_SRCS
|
||||||
|
|
||||||
|
set(statusnotifierwatcher_xml ${KNOTIFICATIONS_DBUS_INTERFACES_DIR}/kf5_org.kde.StatusNotifierWatcher.xml)
|
||||||
|
qt5_add_dbus_interface(statusnotifieritem_engine_SRCS ${statusnotifierwatcher_xml} statusnotifierwatcher_interface)
|
||||||
|
+qt5_add_dbus_interface(statusnotifieritem_engine_SRCS ../mpris2/org.freedesktop.DBus.Properties.xml dbusproperties)
|
||||||
|
|
||||||
|
set(statusnotifieritem_xml ${KNOTIFICATIONS_DBUS_INTERFACES_DIR}/kf5_org.kde.StatusNotifierItem.xml)
|
||||||
|
|
||||||
|
diff --git a/dataengines/statusnotifieritem/statusnotifieritem_engine.cpp b/dataengines/statusnotifieritem/statusnotifieritem_engine.cpp
|
||||||
|
index 08a8c86..ae99a80 100644
|
||||||
|
--- a/dataengines/statusnotifieritem/statusnotifieritem_engine.cpp
|
||||||
|
+++ b/dataengines/statusnotifieritem/statusnotifieritem_engine.cpp
|
||||||
|
@@ -20,8 +20,11 @@
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include "statusnotifieritem_engine.h"
|
||||||
|
+#include <QStringList>
|
||||||
|
#include "statusnotifieritemsource.h"
|
||||||
|
|
||||||
|
+#include "dbusproperties.h"
|
||||||
|
+
|
||||||
|
#include <QDebug>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
@@ -89,17 +92,26 @@ void StatusNotifierItemEngine::registerWatcher(const QString& service)
|
||||||
|
|
||||||
|
m_statusNotifierWatcher = new org::kde::StatusNotifierWatcher(s_watcherServiceName, QStringLiteral("/StatusNotifierWatcher"),
|
||||||
|
QDBusConnection::sessionBus());
|
||||||
|
- if (m_statusNotifierWatcher->isValid() &&
|
||||||
|
- m_statusNotifierWatcher->property("ProtocolVersion").toInt() == s_protocolVersion) {
|
||||||
|
+ if (m_statusNotifierWatcher->isValid()) {
|
||||||
|
+ m_statusNotifierWatcher->call(QDBus::NoBlock, QStringLiteral("RegisterStatusNotifierHost"), m_serviceName);
|
||||||
|
+
|
||||||
|
+ OrgFreedesktopDBusPropertiesInterface propetriesIface(m_statusNotifierWatcher->service(), m_statusNotifierWatcher->path(), m_statusNotifierWatcher->connection());
|
||||||
|
+
|
||||||
|
+ QDBusPendingReply<QDBusVariant> pendingItems = propetriesIface.Get(m_statusNotifierWatcher->interface(), "RegisteredStatusNotifierItems");
|
||||||
|
+
|
||||||
|
+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingItems, this);
|
||||||
|
+ connect(watcher, &QDBusPendingCallWatcher::finished, this, [=]() {
|
||||||
|
+ watcher->deleteLater();
|
||||||
|
+ QDBusReply<QDBusVariant> reply = *watcher;
|
||||||
|
+ QStringList registeredItems = reply.value().variant().toStringList();
|
||||||
|
+ foreach (const QString &service, registeredItems) {
|
||||||
|
+ newItem(service);
|
||||||
|
+ }
|
||||||
|
+ });
|
||||||
|
+
|
||||||
|
connect(m_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierItemRegistered, this, &StatusNotifierItemEngine::serviceRegistered);
|
||||||
|
connect(m_statusNotifierWatcher, &OrgKdeStatusNotifierWatcherInterface::StatusNotifierItemUnregistered, this, &StatusNotifierItemEngine::serviceUnregistered);
|
||||||
|
|
||||||
|
- m_statusNotifierWatcher->call(QDBus::NoBlock, QStringLiteral("RegisterStatusNotifierHost"), m_serviceName);
|
||||||
|
-
|
||||||
|
- QStringList registeredItems = m_statusNotifierWatcher->property("RegisteredStatusNotifierItems").value<QStringList>();
|
||||||
|
- foreach (const QString &service, registeredItems) {
|
||||||
|
- newItem(service);
|
||||||
|
- }
|
||||||
|
} else {
|
||||||
|
delete m_statusNotifierWatcher;
|
||||||
|
m_statusNotifierWatcher = 0;
|
||||||
|
--
|
||||||
|
2.5.0
|
||||||
|
|
Loading…
Reference in new issue