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

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:29:08 UTC 2016


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

The following commit has been merged in the master branch:
commit 217d4b60ff1affaadb4c2625e3ad7c29d0af6acc
Author: Albert Vaca <albertvaka at gmail.com>
Date:   Sat Sep 12 08:48:24 2015 -0700

    Fixed outging capabilities
---
 core/device.cpp | 11 +++++++----
 core/device.h   |  1 +
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/core/device.cpp b/core/device.cpp
index 6bcaf44..46df8bd 100644
--- a/core/device.cpp
+++ b/core/device.cpp
@@ -110,6 +110,7 @@ void Device::reloadPlugins()
     QMultiMap<QString, KdeConnectPlugin*> newPluginsByIncomingInterface;
     QMultiMap<QString, KdeConnectPlugin*> newPluginsByOutgoingInterface;
     QSet<QString> supportedIncomingInterfaces;
+    QSet<QString> supportedOutgoingInterfaces;
     QStringList unsupportedPlugins;
 
     if (isPaired() && isReachable()) { //Do not load any plugin for unpaired devices, nor useless loading them for unreachable devices
@@ -119,7 +120,6 @@ void Device::reloadPlugins()
         PluginLoader* loader = PluginLoader::instance();
         const bool deviceSupportsCapabilities = !m_incomingCapabilities.isEmpty() || !m_outgoingCapabilities.isEmpty();
 
-        //Code borrowed from KWin
         foreach (const QString& pluginName, loader->getPluginList()) {
             const KPluginMetaData service = loader->getPluginInfo(pluginName);
             const QSet<QString> incomingInterfaces = KPluginMetaData::readStringList(service.rawData(), "X-KdeConnect-SupportedPackageType").toSet();
@@ -129,13 +129,13 @@ void Device::reloadPlugins()
 
             if (pluginEnabled) {
                 supportedIncomingInterfaces += incomingInterfaces;
+                supportedOutgoingInterfaces += outgoingInterfaces;
             }
 
             //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.
-
             const bool capabilitiesSupported = deviceSupportsCapabilities && (!incomingInterfaces.isEmpty() || !outgoingInterfaces.isEmpty());
             if (capabilitiesSupported
                 && (m_incomingCapabilities & outgoingInterfaces).isEmpty()
@@ -159,6 +159,7 @@ void Device::reloadPlugins()
                 foreach(const QString& interface, outgoingInterfaces) {
                     newPluginsByOutgoingInterface.insert(interface, plugin);
                 }
+
                 newPluginMap[pluginName] = plugin;
             }
         }
@@ -167,12 +168,14 @@ void Device::reloadPlugins()
     //Erase all left plugins in the original map (meaning that we don't want
     //them anymore, otherwise they would have been moved to the newPluginMap)
     const QStringList newSupportedIncomingInterfaces = supportedIncomingInterfaces.toList();
+    const QStringList newSupportedOutgoingInterfaces = supportedOutgoingInterfaces.toList();
     const bool capabilitiesChanged = (m_pluginsByOutgoingInterface != newPluginsByOutgoingInterface
                                      || m_supportedIncomingInterfaces != newSupportedIncomingInterfaces);
     qDeleteAll(m_plugins);
     m_plugins = newPluginMap;
-    m_pluginsByOutgoingInterface = newPluginsByOutgoingInterface;
     m_supportedIncomingInterfaces = newSupportedIncomingInterfaces;
+    m_supportedOutgoingInterfaces = newSupportedOutgoingInterfaces;
+    m_pluginsByOutgoingInterface = newPluginsByOutgoingInterface;
     m_pluginsByIncomingInterface = newPluginsByIncomingInterface;
     m_unsupportedPlugins = unsupportedPlugins;
 
@@ -185,7 +188,7 @@ void Device::reloadPlugins()
     {
         NetworkPackage np(PACKAGE_TYPE_CAPABILITIES);
         np.set<QStringList>("IncomingCapabilities", newSupportedIncomingInterfaces);
-        np.set<QStringList>("OutgoingCapabilities", newPluginsByOutgoingInterface.keys());
+        np.set<QStringList>("OutgoingCapabilities", newSupportedOutgoingInterfaces);
         sendPackage(np);
     }
 }
diff --git a/core/device.h b/core/device.h
index f0c9e51..fbffb99 100644
--- a/core/device.h
+++ b/core/device.h
@@ -159,6 +159,7 @@ private: //Fields (TODO: dPointer!)
     QSet<QString> m_incomingCapabilities;
     QSet<QString> m_outgoingCapabilities;
     QStringList m_supportedIncomingInterfaces;
+    QStringList m_supportedOutgoingInterfaces;
     QStringList m_unsupportedPlugins;
 };
 

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list