No need to set up the timeout every time

This commit is contained in:
Aleix Pol 2015-03-14 00:39:13 +01:00
parent 5d8cf9544c
commit 4c195e1a16

View file

@ -57,6 +57,11 @@ Device::Device(QObject* parent, const QString& id)
m_deviceType = str2type(info.deviceType);
m_publicKey = QCA::RSAPublicKey::fromPEM(info.publicKey);
m_pairingTimeut.setSingleShot(true);
m_pairingTimeut.setInterval(30 * 1000); //30 seconds of timeout
connect(&m_pairingTimeut, SIGNAL(timeout()),
this, SLOT(pairingTimeout()));
//Register in bus
QDBusConnection::sessionBus().registerObject(dbusPath(), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportAdaptors);
}
@ -202,11 +207,7 @@ void Device::requestPair()
return;
}
m_pairingTimeut.setSingleShot(true);
m_pairingTimeut.start(30 * 1000); //30 seconds of timeout
connect(&m_pairingTimeut, SIGNAL(timeout()),
this, SLOT(pairingTimeout()));
m_pairingTimeut.start();
}
void Device::unpair()