[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:27:03 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=920d945
The following commit has been merged in the master branch:
commit 920d945a5df1f2b9576689b4c5425b02d86400c8
Author: Albert Vaca <albertvaka at gmail.com>
Date: Tue Oct 1 03:11:22 2013 +0200
ProtocolVersion is read for already known devices too
It might have changed since last connection, so we don't store it
---
kded/daemon.cpp | 2 +-
kded/device.cpp | 16 +++++++++-------
kded/device.h | 2 +-
3 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/kded/daemon.cpp b/kded/daemon.cpp
index e873ed7..16355d5 100644
--- a/kded/daemon.cpp
+++ b/kded/daemon.cpp
@@ -140,7 +140,7 @@ void Daemon::onNewDeviceLink(const NetworkPackage& identityPackage, DeviceLink*
if (mDevices.contains(id)) {
//qDebug() << "It is a known device";
Device* device = mDevices[id];
- device->addLink(dl);
+ device->addLink(identityPackage, dl);
} else {
//qDebug() << "It is a new device";
diff --git a/kded/device.cpp b/kded/device.cpp
index 035d3a2..b7b015d 100644
--- a/kded/device.cpp
+++ b/kded/device.cpp
@@ -34,6 +34,8 @@ Device::Device(const QString& id)
m_pairStatus = Device::Paired;
+ m_protocolVersion = NetworkPackage::ProtocolVersion; //We don't know it yet
+
//Register in bus
QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors);
@@ -43,13 +45,8 @@ Device::Device(const NetworkPackage& identityPackage, DeviceLink* dl)
{
m_deviceId = identityPackage.get<QString>("deviceId");
m_deviceName = identityPackage.get<QString>("deviceName");
-
m_protocolVersion = identityPackage.get<int>("protocolVersion");
- if (m_protocolVersion != NetworkPackage::ProtocolVersion) {
- qWarning() << m_deviceName << "- warning, device uses a different protocol version" << m_protocolVersion << "expected" << NetworkPackage::ProtocolVersion;
- }
-
- addLink(dl);
+ addLink(identityPackage, dl);
m_pairStatus = Device::NotPaired;
@@ -195,10 +192,15 @@ static bool lessThan(DeviceLink* p1, DeviceLink* p2)
return p1->provider()->priority() > p2->provider()->priority();
}
-void Device::addLink(DeviceLink* link)
+void Device::addLink(const NetworkPackage& identityPackage, DeviceLink* link)
{
//qDebug() << "Adding link to" << id() << "via" << link->provider();
+ m_protocolVersion = identityPackage.get<int>("protocolVersion");
+ if (m_protocolVersion != NetworkPackage::ProtocolVersion) {
+ qWarning() << m_deviceName << "- warning, device uses a different protocol version" << m_protocolVersion << "expected" << NetworkPackage::ProtocolVersion;
+ }
+
connect(link, SIGNAL(destroyed(QObject*)),
this, SLOT(linkDestroyed(QObject*)));
diff --git a/kded/device.h b/kded/device.h
index ea87dea..7ac646b 100644
--- a/kded/device.h
+++ b/kded/device.h
@@ -62,7 +62,7 @@ public:
QString dbusPath() const { return "/modules/kdeconnect/devices/"+id(); }
//Add and remove links
- void addLink(DeviceLink*);
+ void addLink(const NetworkPackage& identityPackage, DeviceLink*);
void removeLink(DeviceLink*);
Q_SCRIPTABLE bool isPaired() const { return m_pairStatus==Device::Paired; }
--
kdeconnect packaging
More information about the pkg-kde-commits
mailing list