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

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:28:36 UTC 2016


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

The following commit has been merged in the master branch:
commit b592dc99a0eb3943b5712cc0e69421fb40992d6f
Author: Aleix Pol <aleixpol at kde.org>
Date:   Thu Jun 11 16:19:00 2015 +0200

    Merge pairingSuccessful and unpaired signals into pairingChanged(bool)
    
    REVIEW: 124067
---
 core/device.cpp |  4 ++--
 core/device.h   |  6 +++---
 kcm/kcm.cpp     | 44 +++++++++++---------------------------------
 kcm/kcm.h       |  3 +--
 4 files changed, 17 insertions(+), 40 deletions(-)

diff --git a/core/device.cpp b/core/device.cpp
index 264e78b..d2ceb84 100644
--- a/core/device.cpp
+++ b/core/device.cpp
@@ -226,7 +226,7 @@ void Device::unpairInternal()
     m_pairStatus = Device::NotPaired;
     KdeConnectConfig::instance()->removeTrustedDevice(id());
     reloadPlugins(); //Will unload the plugins
-    Q_EMIT unpaired();
+    Q_EMIT pairingChanged(false);
 }
 
 void Device::pairingTimeout()
@@ -440,7 +440,7 @@ void Device::setAsPaired()
 
     reloadPlugins(); //Will actually load the plugins
 
-    Q_EMIT pairingSuccesful();
+    Q_EMIT pairingChanged(true);
 
 }
 
diff --git a/core/device.h b/core/device.h
index f1610c2..1512721 100644
--- a/core/device.h
+++ b/core/device.h
@@ -45,7 +45,7 @@ class KDECONNECTCORE_EXPORT Device
     Q_PROPERTY(QString iconName READ iconName CONSTANT)
     Q_PROPERTY(QString statusIconName READ statusIconName)
     Q_PROPERTY(bool isReachable READ isReachable NOTIFY reachableStatusChanged)
-    Q_PROPERTY(bool isPaired READ isPaired)
+    Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairingChanged)
 
     enum PairStatus {
         NotPaired,
@@ -123,9 +123,8 @@ private Q_SLOTS:
 Q_SIGNALS:
     Q_SCRIPTABLE void reachableStatusChanged();
     Q_SCRIPTABLE void pluginsChanged();
-    Q_SCRIPTABLE void pairingSuccesful();
+    Q_SCRIPTABLE void pairingChanged(bool paired);
     Q_SCRIPTABLE void pairingFailed(const QString& error);
-    Q_SCRIPTABLE void unpaired();
     Q_SCRIPTABLE void nameChanged(const QString& name);
 
 private: //Methods
@@ -134,6 +133,7 @@ private: //Methods
     void unpairInternal();
     void setAsPaired();
     bool sendOwnPublicKey();
+    void setPairing(PairStatus newPairing);
 
 private: //Fields (TODO: dPointer!)
     const QString m_deviceId;
diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp
index cf422e3..dc61e1d 100644
--- a/kcm/kcm.cpp
+++ b/kcm/kcm.cpp
@@ -140,12 +140,10 @@ void KdeConnectKcm::deviceSelected(const QModelIndex& current)
     kcmUi->noDevicePlaceholder->setVisible(false);
 
     if (currentDevice) {
-        disconnect(currentDevice,SIGNAL(pairingSuccesful()),
-            this, SLOT(pairingSuccesful()));
+        disconnect(currentDevice,SIGNAL(pairingChanged(bool)),
+            this, SLOT(pairingChanged(bool)));
         disconnect(currentDevice,SIGNAL(pairingFailed(QString)),
             this, SLOT(pairingFailed(QString)));
-        disconnect(currentDevice,SIGNAL(unpaired()),
-            this, SLOT(unpaired()));
     }
 
     //Store previous device config
@@ -194,12 +192,10 @@ void KdeConnectKcm::deviceSelected(const QModelIndex& current)
     kcmUi->name_label->setText(currentDevice->name());
     kcmUi->status_label->setText(currentDevice->isPaired()? i18n("(paired)") : i18n("(unpaired)"));
 
-    connect(currentDevice,SIGNAL(pairingSuccesful()),
-            this, SLOT(pairingSuccesful()));
+    connect(currentDevice,SIGNAL(pairingChanged(bool)),
+            this, SLOT(pairingChanged(bool)));
     connect(currentDevice,SIGNAL(pairingFailed(QString)),
             this, SLOT(pairingFailed(QString)));
-    connect(currentDevice,SIGNAL(unpaired()),
-            this, SLOT(unpaired()));
 
     const QList<KPluginInfo> pluginInfo = KPluginInfo::fromMetaData(KPluginLoader::findPlugins("kdeconnect/"));
     KSharedConfigPtr deviceConfig = KSharedConfig::openConfig(currentDevice->pluginsConfigFile());
@@ -234,46 +230,28 @@ void KdeConnectKcm::unpair()
     currentDevice->unpair();
 }
 
-void KdeConnectKcm::unpaired()
-{
-    DeviceDbusInterface* senderDevice = (DeviceDbusInterface*) sender();
-    devicesModel->deviceStatusChanged(senderDevice->id());
-
-    if (senderDevice != currentDevice) return;
-
-    kcmUi->pair_button->setVisible(true);
-    kcmUi->unpair_button->setVisible(false);
-    kcmUi->progressBar->setVisible(false);
-    kcmUi->ping_button->setVisible(false);
-    kcmUi->status_label->setText(i18n("(unpaired)"));
-}
-
 void KdeConnectKcm::pairingFailed(const QString& error)
 {
     if (sender() != currentDevice) return;
 
-    kcmUi->pair_button->setVisible(true);
-    kcmUi->unpair_button->setVisible(false);
-    kcmUi->progressBar->setVisible(false);
-    kcmUi->ping_button->setVisible(false);
-    kcmUi->status_label->setText(i18n("(unpaired)"));
+    pairingChanged(false);
 
     kcmUi->messages->setText(i18n("Error trying to pair: %1",error));
     kcmUi->messages->animatedShow();
 }
 
-void KdeConnectKcm::pairingSuccesful()
+void KdeConnectKcm::pairingChanged(bool pairing)
 {
     DeviceDbusInterface* senderDevice = (DeviceDbusInterface*) sender();
     devicesModel->deviceStatusChanged(senderDevice->id());
 
     if (senderDevice != currentDevice) return;
 
-    kcmUi->pair_button->setVisible(false);
-    kcmUi->unpair_button->setVisible(true);
-    kcmUi->progressBar->setVisible(false);
-    kcmUi->ping_button->setVisible(true);
-    kcmUi->status_label->setText(i18n("(paired)"));
+    kcmUi->pair_button->setVisible(!pairing);
+    kcmUi->unpair_button->setVisible(pairing);
+    kcmUi->progressBar->setVisible(!pairing);
+    kcmUi->ping_button->setVisible(pairing);
+    kcmUi->status_label->setText(pairing ? i18n("(paired)") : i18n("(unpaired)"));
 }
 
 void KdeConnectKcm::pluginsConfigChanged()
diff --git a/kcm/kcm.h b/kcm/kcm.h
index 1c2b0da..75bcd9e 100644
--- a/kcm/kcm.h
+++ b/kcm/kcm.h
@@ -53,9 +53,8 @@ private Q_SLOTS:
     void pluginsConfigChanged();
     void sendPing();
     void resetSelection();
-    void pairingSuccesful();
+    void pairingChanged(bool);
     void pairingFailed(const QString& error);
-    void unpaired();
     void refresh();
     void renameShow();
     void renameDone();

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list