[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:26:37 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=ff9e8be

The following commit has been merged in the master branch:
commit ff9e8be5adf30eee79ba9637c0e1425eb4057483
Author: Albert Vaca <albertvaka at gmail.com>
Date:   Tue Jun 18 03:05:32 2013 +0200

    KdeService was not compiling
---
 src/avahidevicelocator.cpp | 8 +++++++-
 src/daemon.cpp             | 7 ++++---
 src/daemon.h               | 6 +++---
 src/devicelink.cpp         | 4 +++-
 src/devicelink.h           | 2 +-
 src/devicelocator.h        | 6 ++++++
 src/echodevicelink.h       | 3 ++-
 src/fakedevicelocator.cpp  | 2 +-
 src/udpdevicelink.cpp      | 3 ++-
 src/udpdevicelink.h        | 2 +-
 10 files changed, 30 insertions(+), 13 deletions(-)

diff --git a/src/avahidevicelocator.cpp b/src/avahidevicelocator.cpp
index a59bbdb..2460da8 100644
--- a/src/avahidevicelocator.cpp
+++ b/src/avahidevicelocator.cpp
@@ -43,7 +43,13 @@ DeviceLink* AvahiDeviceLocator::link(QString id) {
     Device* d = visibleDevices[id];
     const DNSSD::RemoteService::Ptr& rs = deviceRoutes[d];
 
-    DeviceLink* dl = new UdpDeviceLink(QHostAddress(rs->hostName()),rs->port());
+    DeviceLink* dl = new UdpDeviceLink(d, QHostAddress(rs->hostName()),rs->port());
+
+    qDebug() << "Sending pair request to device " + id;
+    NetworkPackage np(12345);
+    //TODO: Package contents
+    dl->sendPackage(np);
+
     linkedDevices.append(dl); //Store the ref to be able to delete the memory later
 
     return dl;
diff --git a/src/daemon.cpp b/src/daemon.cpp
index aa189b0..c1b6dd2 100644
--- a/src/daemon.cpp
+++ b/src/daemon.cpp
@@ -80,9 +80,11 @@ Daemon::Daemon(QObject *parent, const QList<QVariant>&)
     deviceLocators.insert(new FakeDeviceLocator());
 
     //TODO: Read paired devices from config
-    pairedDevices.push_back(new Device("MyAndroid","MyAndroid"));
+    //pairedDevices.push_back(new Device("MyAndroid","MyAndroid"));
 
     //At boot time, try to link to all paired devices
+    //FIXME: This should be done for every new visible device, not only at boot
+    //TODO: Add a way to notify discovered/lost devices
     Q_FOREACH (Device* device, pairedDevices) {
         linkTo(device->id());
     }
@@ -122,7 +124,7 @@ bool Daemon::linkDevice(QString id)
 
 }
 
-QString Daemon::listLinkedDevices(long int id)
+QString Daemon::listLinkedDevices()
 {
     QString ret;
 
@@ -137,6 +139,5 @@ QString Daemon::listLinkedDevices(long int id)
 Daemon::~Daemon()
 {
     qDebug() << "SAYONARA BABY";
-
 }
 
diff --git a/src/daemon.h b/src/daemon.h
index cda4a42..dcfab7d 100644
--- a/src/daemon.h
+++ b/src/daemon.h
@@ -61,15 +61,15 @@ public Q_SLOTS:
     Q_SCRIPTABLE bool linkDevice(QString id);
 
 /*
-    Q_SCRIPTABLE bool pairDevice(long id);
+    Q_SCRIPTABLE bool pairDevice(QString id);
 
-    Q_SCRIPTABLE QString listPairedDevices(long id);
+    Q_SCRIPTABLE QString listPairedDevices(QString id);
 
     Q_SCRIPTABLE bool linkAllPairedDevices();
 
 */
 
-    Q_SCRIPTABLE QString listLinkedDevices(long id);
+    Q_SCRIPTABLE QString listLinkedDevices();
 
 private:
 
diff --git a/src/devicelink.cpp b/src/devicelink.cpp
index 8d00c08..f48ac03 100644
--- a/src/devicelink.cpp
+++ b/src/devicelink.cpp
@@ -20,6 +20,8 @@
 
 #include "devicelink.h"
 
-DeviceLink::DeviceLink() {
+DeviceLink::DeviceLink(Device* d)
+    : mDevice(d)
+{
     //gcc complains if we don't add something to compile on a class with virtual functions
 }
\ No newline at end of file
diff --git a/src/devicelink.h b/src/devicelink.h
index 303063b..c6959cd 100644
--- a/src/devicelink.h
+++ b/src/devicelink.h
@@ -33,7 +33,7 @@ class DeviceLink
     Q_OBJECT
 
 public:
-    DeviceLink(Device* d) : mDevice(d) { };
+    DeviceLink(Device* d);
 
     Device* device() { return mDevice; }
     
diff --git a/src/devicelocator.h b/src/devicelocator.h
index 9c5f38a..d970813 100644
--- a/src/devicelocator.h
+++ b/src/devicelocator.h
@@ -50,6 +50,12 @@ public:
     virtual bool pair(Device* d) = 0;
     virtual QList<Device*> discover() = 0;
 
+signals:
+
+    //TODO: Emit this to be able to see if it is a known device
+    //void deviceDiscovered(Device* d);
+    //void deviceLost(QString id);
+
 };
 
 #endif // DEVICELOCATOR_H
diff --git a/src/echodevicelink.h b/src/echodevicelink.h
index 6f832b0..756ec2f 100644
--- a/src/echodevicelink.h
+++ b/src/echodevicelink.h
@@ -25,8 +25,9 @@
 class EchoDeviceLink
     : public DeviceLink
 {
-
 public:
+    EchoDeviceLink(Device* d) : DeviceLink(d) { }
+
     void sendPackage(const NetworkPackage& np) {
         emit receivedPackage(np);
     }
diff --git a/src/fakedevicelocator.cpp b/src/fakedevicelocator.cpp
index 460ca40..2469383 100644
--- a/src/fakedevicelocator.cpp
+++ b/src/fakedevicelocator.cpp
@@ -24,7 +24,7 @@
 FakeDeviceLocator::FakeDeviceLocator()
 {
     fakeDevice = new Device("fake","Fake device");
-    echoDeviceLink = new EchoDeviceLink();
+    echoDeviceLink = new EchoDeviceLink(fakeDevice);
 }
 
 bool FakeDeviceLocator::canLink(QString id) {
diff --git a/src/udpdevicelink.cpp b/src/udpdevicelink.cpp
index 5bdc672..f73f88c 100644
--- a/src/udpdevicelink.cpp
+++ b/src/udpdevicelink.cpp
@@ -21,7 +21,8 @@
 #include "udpdevicelink.h"
 
 
-UdpDeviceLink::UdpDeviceLink(QHostAddress ip, quint16 port)
+UdpDeviceLink::UdpDeviceLink(Device* d, QHostAddress ip, quint16 port)
+    : DeviceLink(d)
 {
 
     mIp = ip;
diff --git a/src/udpdevicelink.h b/src/udpdevicelink.h
index 0e6da86..56bd9bb 100644
--- a/src/udpdevicelink.h
+++ b/src/udpdevicelink.h
@@ -33,7 +33,7 @@ class UdpDeviceLink
     Q_OBJECT
 
 public:
-    UdpDeviceLink(QHostAddress ip, quint16 port);
+    UdpDeviceLink(Device* d, QHostAddress ip, quint16 port);
 
     void sendPackage(const NetworkPackage& np) {
         mUdpSocket->writeDatagram(np.toString(), mIp, mPort);

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list