Fixed bug causing plugins not being unloaded

When unpairing from device
This commit is contained in:
Albert Vaca 2014-01-16 15:48:40 +01:00
parent 904c5484e7
commit 445cb84e89

View file

@ -323,18 +323,19 @@ void Device::privateReceivedPackage(const NetworkPackage& np)
kDebug(kdeconnect_kded()) << "Unpair request";
if (m_pairStatus == Device::Requested) {
PairStatus prevPairStatus = m_pairStatus;
m_pairStatus = Device::NotPaired;
if (prevPairStatus == Device::Requested) {
pairingTimer.stop();
Q_EMIT pairingFailed(i18n("Canceled by other peer"));
} else if (m_pairStatus == Device::Paired) {
} else if (prevPairStatus == Device::Paired) {
KSharedConfigPtr config = KSharedConfig::openConfig("kdeconnectrc");
config->group("trusted_devices").deleteGroup(id());
reloadPlugins();
Q_EMIT unpaired();
}
m_pairStatus = Device::NotPaired;
}
} else if (isPaired()) {