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

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


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

The following commit has been merged in the master branch:
commit 0eb3f019c9f4cf7009ac72dd6371e564c94c77e2
Author: Albert Vaca <albertvaka at gmail.com>
Date:   Fri Aug 16 09:27:32 2013 +0200

    Minor changes
---
 daemon/daemon.cpp                                    |  1 +
 daemon/device.cpp                                    | 20 ++++++--------------
 daemon/device.h                                      |  4 +---
 daemon/plugins/notifications/notificationsplugin.cpp |  2 +-
 daemon/plugins/notifications/notificationsplugin.h   |  4 +++-
 daemon/plugins/ping/pingplugin.cpp                   |  4 ++--
 daemon/plugins/telephony/telephonyplugin.cpp         |  2 +-
 kcm/kcm.cpp                                          | 16 +++++++++++++---
 8 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/daemon/daemon.cpp b/daemon/daemon.cpp
index d4052ea..c2520f7 100644
--- a/daemon/daemon.cpp
+++ b/daemon/daemon.cpp
@@ -160,6 +160,7 @@ void Daemon::onDeviceReachableStatusChanged()
     if (!device->reachable()) {
 
         if (!device->paired()) {
+            qDebug() << "Destroying device";
             Q_EMIT deviceRemoved(id);
             mDevices.remove(id);
             device->deleteLater();
diff --git a/daemon/device.cpp b/daemon/device.cpp
index e96cb95..030c35b 100644
--- a/daemon/device.cpp
+++ b/daemon/device.cpp
@@ -18,6 +18,7 @@
 
 Device::Device(const QString& id, const QString& name)
 {
+
     m_deviceId = id;
     m_deviceName = name;
     m_paired = true;
@@ -32,6 +33,7 @@ Device::Device(const QString& id, const QString& name)
 
 Device::Device(const QString& id, const QString& name, DeviceLink* link)
 {
+
     m_deviceId = id;
     m_deviceName = name;
     m_paired = false;
@@ -45,23 +47,11 @@ Device::Device(const QString& id, const QString& name, DeviceLink* link)
     QDBusConnection::sessionBus().registerObject("/modules/kdeconnect/devices/"+id, this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors);
 
 }
-/*
-Device::Device(const QString& id, const QString& name, DeviceLink* link)
-{
-    m_deviceId = id;
-    m_deviceName = id; //Temporary name
-    m_paired = false;
-    m_knownIdentiy = false;
-
-    addLink(link);
 
-    NetworkPackage identityRequest;
-    identityRequest.setType("IDENTITY_REQUEST");
-    link->sendPackage(identityRequest);
+Device::~Device()
+{
 
-    QDBusConnection::sessionBus().registerObject("/modules/kdeconnect/Devices/"+id, this);
 }
-*/
 
 bool Device::hasPlugin(const QString& name)
 {
@@ -123,9 +113,11 @@ void Device::setPair(bool b)
     if (b) {
         qDebug() << name() << "paired";
         config->group("devices").group("paired").group(id()).writeEntry("name",name());
+        Q_EMIT reachableStatusChanged();
     } else {
         qDebug() << name() << "unpaired";
         config->group("devices").group("paired").deleteGroup(id());
+        //Do not Q_EMIT reachableStatusChanged() because we do not want it to suddenly disappear from device list
     }
     reloadPlugins();
 }
diff --git a/daemon/device.h b/daemon/device.h
index ad2ee61..625ab03 100644
--- a/daemon/device.h
+++ b/daemon/device.h
@@ -46,9 +46,7 @@ public:
     //Device known via an incoming connection sent to us via a devicelink, we know everything but we don't trust it yet
     Device(const QString& id, const QString& name, DeviceLink* dl);
 
-    //Device known via discovery, we know nothing and have to ask for a presentation package
-    //(not supported yet, do we need it or we can rely on the device presenging itself?)
-    //Device(const QString& id, DeviceLink* dl);
+    virtual ~Device();
 
     QString id() const { return m_deviceId; }
     QString name() const { return m_deviceName; }
diff --git a/daemon/plugins/notifications/notificationsplugin.cpp b/daemon/plugins/notifications/notificationsplugin.cpp
index fdafeb7..2bcbe87 100644
--- a/daemon/plugins/notifications/notificationsplugin.cpp
+++ b/daemon/plugins/notifications/notificationsplugin.cpp
@@ -29,7 +29,7 @@ K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_notifications", "kdeconnect
 NotificationsPlugin::NotificationsPlugin(QObject* parent, const QVariantList& args)
     : KdeConnectPlugin(parent, args)
 {
-    trayIcon = new KStatusNotifierItem(parent);
+    trayIcon = new KStatusNotifierItem(this);
     trayIcon->setIconByName("smartphone");
     trayIcon->setTitle(device()->name());
 }
diff --git a/daemon/plugins/notifications/notificationsplugin.h b/daemon/plugins/notifications/notificationsplugin.h
index 55f2528..0512cb0 100644
--- a/daemon/plugins/notifications/notificationsplugin.h
+++ b/daemon/plugins/notifications/notificationsplugin.h
@@ -31,7 +31,6 @@ class NotificationsPlugin
     : public KdeConnectPlugin
 {
     Q_OBJECT
-    KStatusNotifierItem* trayIcon;
 
 public:
     explicit NotificationsPlugin(QObject *parent, const QVariantList &args);
@@ -40,6 +39,9 @@ public:
 public Q_SLOTS:
     virtual bool receivePackage(const NetworkPackage& np);
 
+private:
+    KStatusNotifierItem* trayIcon;
+
 };
 
 #endif
diff --git a/daemon/plugins/ping/pingplugin.cpp b/daemon/plugins/ping/pingplugin.cpp
index 8ffb317..4aec232 100644
--- a/daemon/plugins/ping/pingplugin.cpp
+++ b/daemon/plugins/ping/pingplugin.cpp
@@ -46,8 +46,8 @@ bool PingPlugin::receivePackage(const NetworkPackage& np)
     KNotification* notification = new KNotification("pingReceived"); //KNotification::Persistent
     notification->setPixmap(KIcon("dialog-ok").pixmap(48, 48));
     notification->setComponentData(KComponentData("kdeconnect", "kdeconnect"));
-    notification->setTitle("Ping!");
-    notification->setText(device()->name());
+    notification->setTitle(device()->name());
+    notification->setText("Ping!");
     notification->sendEvent();
 
     return true;
diff --git a/daemon/plugins/telephony/telephonyplugin.cpp b/daemon/plugins/telephony/telephonyplugin.cpp
index 48f63a7..71e0dba 100644
--- a/daemon/plugins/telephony/telephonyplugin.cpp
+++ b/daemon/plugins/telephony/telephonyplugin.cpp
@@ -60,7 +60,7 @@ KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
         //TODO: return NULL if !debug
         type = "unknownEvent";
         icon = "pda";
-        content = "Unknown notification type: " + event;
+        content = "Unknown telephony event: " + event;
     }
 
     qDebug() << "Creating notification with type:" << type;
diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp
index ca82bfc..1bdd657 100644
--- a/kcm/kcm.cpp
+++ b/kcm/kcm.cpp
@@ -120,9 +120,19 @@ void KdeConnectKcm::deviceSelected(const QModelIndex& current)
 void KdeConnectKcm::trustedStateChanged(bool b)
 {
     if (!currentDevice) return;
-    currentDevice->setPair(b);
-    devicesModel->deviceStatusChanged(currentDevice->id());
-
+    QDBusPendingReply<void> pendingReply = currentDevice->setPair(b);
+    pendingReply.waitForFinished();
+    if (pendingReply.isValid()) {
+        //If dbus was down, calling this would make kcm crash
+        devicesModel->deviceStatusChanged(currentDevice->id());
+    } else {
+        //Revert checkbox
+        disconnect(kcmUi->trust_checkbox, SIGNAL(toggled(bool)),
+                   this, SLOT(trustedStateChanged(bool)));
+        kcmUi->trust_checkbox->setCheckState(b? Qt::Unchecked : Qt::Checked);
+        connect(kcmUi->trust_checkbox, SIGNAL(toggled(bool)),
+                this, SLOT(trustedStateChanged(bool)));
+    }
 }
 
 void KdeConnectKcm::pluginsConfigChanged()

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list