[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:28:37 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=7c2e2fb
The following commit has been merged in the master branch:
commit 7c2e2fb72618cb4f5a1e7d0b9c805378b1a55669
Author: Aleix Pol <aleixpol at kde.org>
Date: Sat Jun 13 01:28:36 2015 +0200
QML-ify
Add API to call random public plugin methods
qdbusxml2cpp is not generating the Q_PROPERTY attribute. For now [1], add
it ourselves by addding a proxy signal.
REVIEW: 124077
---
interfaces/dbusinterfaces.cpp | 8 +++++++-
interfaces/dbusinterfaces.h | 8 ++++++++
kcm/kcm.cpp | 3 +--
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/interfaces/dbusinterfaces.cpp b/interfaces/dbusinterfaces.cpp
index 141ef64..6ee93bd 100644
--- a/interfaces/dbusinterfaces.cpp
+++ b/interfaces/dbusinterfaces.cpp
@@ -40,7 +40,7 @@ DaemonDbusInterface::~DaemonDbusInterface()
DeviceDbusInterface::DeviceDbusInterface(const QString& id, QObject* parent)
: OrgKdeKdeconnectDeviceInterface(activatedService(), "/modules/kdeconnect/devices/"+id, QDBusConnection::sessionBus(), parent)
{
-
+ connect(this, &OrgKdeKdeconnectDeviceInterface::pairingChanged, this, &DeviceDbusInterface::pairingChangedProxy);
}
DeviceDbusInterface::~DeviceDbusInterface()
@@ -48,6 +48,12 @@ DeviceDbusInterface::~DeviceDbusInterface()
}
+void DeviceDbusInterface::pluginCall(const QString &plugin, const QString &method)
+{
+ QDBusMessage msg = QDBusMessage::createMethodCall("org.kde.kdeconnect", "/modules/kdeconnect/devices/"+id()+'/'+plugin, "org.kde.kdeconnect.device."+plugin, method);
+ QDBusConnection::sessionBus().asyncCall(msg);
+}
+
DeviceBatteryDbusInterface::DeviceBatteryDbusInterface(const QString& id, QObject* parent)
: OrgKdeKdeconnectDeviceBatteryInterface(activatedService(), "/modules/kdeconnect/devices/"+id, QDBusConnection::sessionBus(), parent)
{
diff --git a/interfaces/dbusinterfaces.h b/interfaces/dbusinterfaces.h
index 8f49fe3..142da39 100644
--- a/interfaces/dbusinterfaces.h
+++ b/interfaces/dbusinterfaces.h
@@ -47,9 +47,17 @@ class KDECONNECTINTERFACES_EXPORT DeviceDbusInterface
: public OrgKdeKdeconnectDeviceInterface
{
Q_OBJECT
+// Workaround because OrgKdeKdeconnectDeviceInterface is not generating
+// the signals for the properties
+ Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairingChangedProxy)
public:
DeviceDbusInterface(const QString& deviceId, QObject* parent = 0);
virtual ~DeviceDbusInterface();
+
+ Q_SCRIPTABLE void pluginCall(const QString &plugin, const QString &method);
+
+Q_SIGNALS:
+ void pairingChangedProxy(bool paired);
};
class KDECONNECTINTERFACES_EXPORT DeviceBatteryDbusInterface
diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp
index dc61e1d..e3f26e1 100644
--- a/kcm/kcm.cpp
+++ b/kcm/kcm.cpp
@@ -276,8 +276,7 @@ void KdeConnectKcm::save()
void KdeConnectKcm::sendPing()
{
if (!currentDevice) return;
- QDBusMessage msg = QDBusMessage::createMethodCall("org.kde.kdeconnect", "/modules/kdeconnect/devices/"+currentDevice->id()+"/ping", "org.kde.kdeconnect.device.ping", "sendPing");
- QDBusConnection::sessionBus().call(msg);
+ currentDevice->pluginCall("ping", "sendPing");
}
QSize KdeConnectKcm::sizeHint() const
--
kdeconnect packaging
More information about the pkg-kde-commits
mailing list