From 445cb84e897c08b372eeb557189dfc52f3fb0231 Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Thu, 16 Jan 2014 15:48:40 +0100 Subject: [PATCH] Fixed bug causing plugins not being unloaded When unpairing from device --- kded/device.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kded/device.cpp b/kded/device.cpp index 3550888c4..5366a17c3 100644 --- a/kded/device.cpp +++ b/kded/device.cpp @@ -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()) {