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

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


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

The following commit has been merged in the master branch:
commit a0da8ba8583f78ca047a2cf8012dd39eabedf52d
Author: Aleix Pol <aleixpol at kde.org>
Date:   Tue Sep 8 20:03:44 2015 +0200

    Let the KPluginSelector react to changes in the plugin configuration
    
    Mainly whenever the remote capabilities change.
    
    Reviewed by The Vaca Man
---
 core/device.cpp | 39 ++++++++++++++++++++-------------------
 kcm/kcm.cpp     | 24 +++++++++++-------------
 kcm/kcm.h       |  1 +
 3 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/core/device.cpp b/core/device.cpp
index 79562f1..0d6611b 100644
--- a/core/device.cpp
+++ b/core/device.cpp
@@ -120,28 +120,29 @@ void Device::reloadPlugins()
 
         //Code borrowed from KWin
         foreach (const QString& pluginName, loader->getPluginList()) {
-            if (isPluginEnabled(pluginName)) {
-                KdeConnectPlugin* plugin = m_plugins.take(pluginName);
-
-                const KPluginMetaData service = loader->getPluginInfo(pluginName);
-                QSet<QString> incomingInterfaces = KPluginMetaData::readStringList(service.rawData(), "X-KdeConnect-SupportedPackageType").toSet();
-                QSet<QString> outgoingInterfaces = KPluginMetaData::readStringList(service.rawData(), "X-KdeConnect-OutgoingPackageType").toSet();
+            const KPluginMetaData service = loader->getPluginInfo(pluginName);
+            const QSet<QString> incomingInterfaces = KPluginMetaData::readStringList(service.rawData(), "X-KdeConnect-SupportedPackageType").toSet();
+            const QSet<QString> outgoingInterfaces = KPluginMetaData::readStringList(service.rawData(), "X-KdeConnect-OutgoingPackageType").toSet();
 
+            const bool pluginEnabled = isPluginEnabled(pluginName);
+            if (pluginEnabled)
                 supportedIncomingInterfaces += incomingInterfaces;
 
-                //If we don't find intersection with the received on one end and the sent on the other, we don't
-                //let the plugin stay
-                //Also, if no capabilities are specified on the other end, we don't apply this optimizaton, as
-                //we assume that the other client doesn't know about capabilities.
-                if ((!m_incomingCapabilities.isEmpty() || !m_outgoingCapabilities.isEmpty())
-                    && (m_incomingCapabilities & outgoingInterfaces).isEmpty()
-                    && (m_outgoingCapabilities & incomingInterfaces).isEmpty()
-                ) {
-                    qCWarning(KDECONNECT_CORE) << "not loading " << pluginName << "because of unmatched capabilities";
-                    delete plugin;
-                    unsupportedPlugins.append(pluginName);
-                    continue;
-                }
+            //If we don't find intersection with the received on one end and the sent on the other, we don't
+            //let the plugin stay
+            //Also, if no capabilities are specified on the other end, we don't apply this optimizaton, as
+            //we assume that the other client doesn't know about capabilities.
+            if ((!m_incomingCapabilities.isEmpty() || !m_outgoingCapabilities.isEmpty())
+                && (m_incomingCapabilities & outgoingInterfaces).isEmpty()
+                && (m_outgoingCapabilities & incomingInterfaces).isEmpty()
+            ) {
+                qCWarning(KDECONNECT_CORE) << "not loading " << pluginName << "because of unmatched capabilities";
+                unsupportedPlugins.append(pluginName);
+                continue;
+            }
+
+            if (pluginEnabled) {
+                KdeConnectPlugin* plugin = m_plugins.take(pluginName);
 
                 if (!plugin) {
                     plugin = loader->instantiatePluginForDevice(pluginName, this);
diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp
index 9495be7..82fcab4 100644
--- a/kcm/kcm.cpp
+++ b/kcm/kcm.cpp
@@ -153,14 +153,8 @@ void KdeConnectKcm::resetSelection()
 
 void KdeConnectKcm::deviceSelected(const QModelIndex& current)
 {
-
-    kcmUi->noDevicePlaceholder->setVisible(false);
-
     if (currentDevice) {
-        disconnect(currentDevice,SIGNAL(pairingChanged(bool)),
-            this, SLOT(pairingChanged(bool)));
-        disconnect(currentDevice,SIGNAL(pairingFailed(QString)),
-            this, SLOT(pairingFailed(QString)));
+        disconnect(currentDevice, 0, this, 0);
     }
 
     //Store previous device config
@@ -175,6 +169,16 @@ void KdeConnectKcm::deviceSelected(const QModelIndex& current)
     currentIndex = sortProxyModel->mapToSource(current);
     currentDevice = devicesModel->getDevice(currentIndex.row());
 
+    resetCurrentDevice();
+
+    connect(currentDevice, SIGNAL(pluginsChanged()), this, SLOT(resetCurrentDevice()));
+    connect(currentDevice, SIGNAL(pairingChanged(bool)), this, SLOT(pairingChanged(bool)));
+    connect(currentDevice, SIGNAL(pairingFailed(QString)), this, SLOT(pairingFailed(QString)));
+}
+
+void KdeConnectKcm::resetCurrentDevice()
+{
+    kcmUi->noDevicePlaceholder->setVisible(false);
     bool valid = (currentDevice != nullptr && currentDevice->isValid());
     kcmUi->deviceInfo->setVisible(valid);
     if (!valid) {
@@ -210,11 +214,6 @@ 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(pairingChanged(bool)),
-            this, SLOT(pairingChanged(bool)));
-    connect(currentDevice,SIGNAL(pairingFailed(QString)),
-            this, SLOT(pairingFailed(QString)));
-
     const QList<KPluginInfo> pluginInfo = KPluginInfo::fromMetaData(KPluginLoader::findPlugins("kdeconnect/"));
     QList<KPluginInfo> availablePluginInfo;
     QList<KPluginInfo> missingPluginInfo;
@@ -234,7 +233,6 @@ void KdeConnectKcm::deviceSelected(const QModelIndex& current)
 
     connect(kcmUi->pluginSelector, SIGNAL(changed(bool)),
             this, SLOT(pluginsConfigChanged()));
-
 }
 
 void KdeConnectKcm::requestPair()
diff --git a/kcm/kcm.h b/kcm/kcm.h
index 75bcd9e..1fcbfa9 100644
--- a/kcm/kcm.h
+++ b/kcm/kcm.h
@@ -59,6 +59,7 @@ private Q_SLOTS:
     void renameShow();
     void renameDone();
     void setRenameMode(bool b);
+    void resetCurrentDevice();
 
 private:
     Ui::KdeConnectKcmUi* kcmUi;

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list