diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-12-23 10:25:58 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-12-23 09:42:06 +0000 |
commit | 2fc35937033fcfb533cf230a23292a0667ef65da (patch) | |
tree | dae954d08bef376dc4c0d16cb8c83093efd9e132 | |
parent | 5e2856bcbea2c9668fa1b02aa2278659e8d1da7b (diff) |
Remove unused isConnecting member variable in QLECPrivateOSX
Most likely it was used before some changes rendered it unused.
At this point the variable was initialized to false and never ever
set to true.
Change-Id: I5b60cf83bc362ff53f8ce276c16392aada9efc69
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
-rw-r--r-- | src/bluetooth/qlowenergycontroller_osx.mm | 19 | ||||
-rw-r--r-- | src/bluetooth/qlowenergycontroller_osx_p.h | 6 |
2 files changed, 6 insertions, 19 deletions
diff --git a/src/bluetooth/qlowenergycontroller_osx.mm b/src/bluetooth/qlowenergycontroller_osx.mm index bd9a99bb..a0b33a95 100644 --- a/src/bluetooth/qlowenergycontroller_osx.mm +++ b/src/bluetooth/qlowenergycontroller_osx.mm @@ -132,7 +132,6 @@ UUIDList qt_servicesUuids(NSArray *services) QLowEnergyControllerPrivateOSX::QLowEnergyControllerPrivateOSX(QLowEnergyController *q) : q_ptr(q), - isConnecting(false), lastError(QLowEnergyController::NoError), controllerState(QLowEnergyController::UnconnectedState), addressType(QLowEnergyController::PublicAddress) @@ -165,7 +164,6 @@ QLowEnergyControllerPrivateOSX::QLowEnergyControllerPrivateOSX(QLowEnergyControl : q_ptr(q), deviceUuid(deviceInfo.deviceUuid()), deviceName(deviceInfo.name()), - isConnecting(false), lastError(QLowEnergyController::NoError), controllerState(QLowEnergyController::UnconnectedState), addressType(QLowEnergyController::PublicAddress) @@ -214,21 +212,18 @@ void QLowEnergyControllerPrivateOSX::_q_connected() controllerState = QLowEnergyController::ConnectedState; - if (!isConnecting) { - emit q_ptr->stateChanged(QLowEnergyController::ConnectedState); - emit q_ptr->connected(); - } + emit q_ptr->stateChanged(QLowEnergyController::ConnectedState); + emit q_ptr->connected(); } void QLowEnergyControllerPrivateOSX::_q_disconnected() { controllerState = QLowEnergyController::UnconnectedState; - if (!isConnecting) { - invalidateServices(); - emit q_ptr->stateChanged(QLowEnergyController::UnconnectedState); - emit q_ptr->disconnected(); - } + invalidateServices(); + emit q_ptr->stateChanged(QLowEnergyController::UnconnectedState); + emit q_ptr->disconnected(); + } void QLowEnergyControllerPrivateOSX::_q_serviceDiscoveryFinished() @@ -513,8 +508,6 @@ void QLowEnergyControllerPrivateOSX::connectToDevice() Q_FUNC_INFO, "invalid state"); Q_ASSERT_X(!deviceUuid.isNull(), Q_FUNC_INFO, "invalid private controller (no device uuid)"); - Q_ASSERT_X(!isConnecting, Q_FUNC_INFO, - "recursive connectToDevice call"); dispatch_queue_t leQueue(OSXBluetooth::qt_LE_queue()); if (!leQueue) { diff --git a/src/bluetooth/qlowenergycontroller_osx_p.h b/src/bluetooth/qlowenergycontroller_osx_p.h index 2d1b2e95..4694203a 100644 --- a/src/bluetooth/qlowenergycontroller_osx_p.h +++ b/src/bluetooth/qlowenergycontroller_osx_p.h @@ -148,12 +148,6 @@ private: QLowEnergyController *q_ptr; QBluetoothUuid deviceUuid; QString deviceName; - // To be sure we set controller's state correctly - // (Connecting or Connected) we have to know if we're - // still inside connectToDevice - this is important, - // if a peripheral is _already_ connected from Core Bluetooth's - // point of view. - bool isConnecting; QString errorString; QLowEnergyController::Error lastError; |