Actually compare the old plugin map

We were comparing to the result after removing all the actually used
plugins
This commit is contained in:
Aleix Pol 2016-08-21 13:21:40 +02:00
parent a96818113d
commit f765e9c0a8

View file

@ -94,7 +94,7 @@ QStringList Device::loadedPlugins() const
void Device::reloadPlugins()
{
QHash<QString, KdeConnectPlugin*> newPluginMap;
QHash<QString, KdeConnectPlugin*> newPluginMap, oldPluginMap = m_plugins;
QMultiMap<QString, KdeConnectPlugin*> newPluginsByIncomingCapability;
if (isTrusted() && isReachable()) { //Do not load any plugin for unpaired devices, nor useless loading them for unreachable devices
@ -124,7 +124,7 @@ void Device::reloadPlugins()
}
}
const bool differentPlugins = m_plugins != newPluginMap;
const bool differentPlugins = oldPluginMap != newPluginMap;
//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)