Rename pairingTimer to m_pairingTimeout

This commit is contained in:
Àlex Fiestas 2014-04-14 21:57:34 +02:00
parent 258739cd93
commit cbd6809932
2 changed files with 8 additions and 8 deletions

View file

@ -164,9 +164,9 @@ void Device::requestPair()
return; return;
} }
pairingTimer.setSingleShot(true); m_pairingTimeut.setSingleShot(true);
pairingTimer.start(30 * 1000); m_pairingTimeut.start(30 * 1000); //30 seconds of timeout
connect(&pairingTimer, SIGNAL(timeout()), connect(&m_pairingTimeut, SIGNAL(timeout()),
this, SLOT(pairingTimeout())); this, SLOT(pairingTimeout()));
} }
@ -294,7 +294,7 @@ void Device::privateReceivedPackage(const NetworkPackage& np)
kDebug(kdeconnect_kded()) << "Already" << (wantsPair? "paired":"unpaired"); kDebug(kdeconnect_kded()) << "Already" << (wantsPair? "paired":"unpaired");
if (m_pairStatus == Device::Requested) { if (m_pairStatus == Device::Requested) {
m_pairStatus = Device::NotPaired; m_pairStatus = Device::NotPaired;
pairingTimer.stop(); m_pairingTimeut.stop();
Q_EMIT pairingFailed(i18n("Canceled by other peer")); Q_EMIT pairingFailed(i18n("Canceled by other peer"));
} }
return; return;
@ -309,7 +309,7 @@ void Device::privateReceivedPackage(const NetworkPackage& np)
kDebug(kdeconnect_kded()) << "ERROR decoding key"; kDebug(kdeconnect_kded()) << "ERROR decoding key";
if (m_pairStatus == Device::Requested) { if (m_pairStatus == Device::Requested) {
m_pairStatus = Device::NotPaired; m_pairStatus = Device::NotPaired;
pairingTimer.stop(); m_pairingTimeut.stop();
} }
Q_EMIT pairingFailed(i18n("Received incorrect key")); Q_EMIT pairingFailed(i18n("Received incorrect key"));
return; return;
@ -346,7 +346,7 @@ void Device::privateReceivedPackage(const NetworkPackage& np)
m_pairStatus = Device::NotPaired; m_pairStatus = Device::NotPaired;
if (prevPairStatus == Device::Requested) { if (prevPairStatus == Device::Requested) {
pairingTimer.stop(); m_pairingTimeut.stop();
Q_EMIT pairingFailed(i18n("Canceled by other peer")); Q_EMIT pairingFailed(i18n("Canceled by other peer"));
} else if (prevPairStatus == Device::Paired) { } else if (prevPairStatus == Device::Paired) {
KSharedConfigPtr config = KSharedConfig::openConfig("kdeconnectrc"); KSharedConfigPtr config = KSharedConfig::openConfig("kdeconnectrc");
@ -414,7 +414,7 @@ void Device::setAsPaired()
m_pairStatus = Device::Paired; m_pairStatus = Device::Paired;
pairingTimer.stop(); //Just in case it was started m_pairingTimeut.stop(); //Just in case it was started
storeAsTrusted(); //Save to the config as trusted storeAsTrusted(); //Save to the config as trusted

View file

@ -132,7 +132,7 @@ private:
QMap<QString, KdeConnectPlugin*> m_plugins; QMap<QString, KdeConnectPlugin*> m_plugins;
QMultiMap<QString, KdeConnectPlugin*> m_pluginsByinterface; QMultiMap<QString, KdeConnectPlugin*> m_pluginsByinterface;
QTimer pairingTimer; QTimer m_pairingTimeut;
void setAsPaired(); void setAsPaired();
void storeAsTrusted(); void storeAsTrusted();