[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdeconnect-kde/sslrefactor] core: Changed the way we detect if capabilities are supported
From: Albert Vaca <albertvaka () gmail ! com>
Date: 2016-05-31 18:10:40
Message-ID: E1b7o7k-00023e-QO () scm ! kde ! org
[Download RAW message or body]
Git commit 4383a42703b51277ba6ff30fcc96f8c6d3929f28 by Albert Vaca.
Committed on 31/05/2016 at 18:10.
Pushed by albertvaka into branch 'sslrefactor'.
Changed the way we detect if capabilities are supported
M +1 -6 core/device.cpp
M +0 -2 core/networkpackage.cpp
http://commits.kde.org/kdeconnect-kde/4383a42703b51277ba6ff30fcc96f8c6d3929f28
diff --git a/core/device.cpp b/core/device.cpp
index c335398..d0112a4 100644
--- a/core/device.cpp
+++ b/core/device.cpp
@@ -111,7 +111,7 @@ void Device::reloadPlugins()
KConfigGroup pluginStates = \
KSharedConfig::openConfig(pluginsConfigFile())->group("Plugins");
PluginLoader* loader = PluginLoader::instance();
- const bool deviceSupportsCapabilities = !m_incomingCapabilities.isEmpty() || \
!m_outgoingCapabilities.isEmpty(); + const bool capabilitiesSupported = \
(m_protocolVersion >= 6);
foreach (const QString& pluginName, loader->getPluginList()) {
const KPluginMetaData service = loader->getPluginInfo(pluginName);
@@ -127,9 +127,6 @@ void Device::reloadPlugins()
//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()
&& (m_outgoingCapabilities & incomingInterfaces).isEmpty()
@@ -272,8 +269,6 @@ void Device::addLink(const NetworkPackage& identityPackage, \
DeviceLink* link) qSort(m_deviceLinks.begin(), m_deviceLinks.end(), lessThan);
if (m_deviceLinks.size() == 1) {
- m_incomingCapabilities = \
identityPackage.get<QStringList>("IncomingCapabilities", \
QStringList()).toSet();
- m_outgoingCapabilities = \
identityPackage.get<QStringList>("OutgoingCapabilities", QStringList()).toSet(); \
reloadPlugins(); //Will load the plugins Q_EMIT reachableStatusChanged();
} else {
diff --git a/core/networkpackage.cpp b/core/networkpackage.cpp
index 2e2d975..59bd21b 100644
--- a/core/networkpackage.cpp
+++ b/core/networkpackage.cpp
@@ -59,8 +59,6 @@ void NetworkPackage::createIdentityPackage(NetworkPackage* np)
np->set("deviceName", config->name());
np->set("deviceType", config->deviceType());
np->set("protocolVersion", NetworkPackage::ProtocolVersion);
- np->set("IncomingCapabilities", PluginLoader::instance()->incomingInterfaces());
- np->set("OutgoingCapabilities", PluginLoader::instance()->outgoingInterfaces());
//qCDebug(KDECONNECT_CORE) << "createIdentityPackage" << np->serialize();
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic