summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2015-10-23 12:26:21 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2015-10-23 13:39:17 +0000
commitc85dcd7102fca2cde3837f36e6f27346a4564e27 (patch)
tree1541ef1fd770c53cb61c79e6f8e6914e519ec336 /src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
parentc7f7d4169f0d913d909b78bff2b5aaa1beb760fd (diff)
Windows: Rename variables which is the system handles
Now the system handles have the 'h' prefix (e.g. hService), not to confuse with the others variables which contains the 'Handle' suffix (e.g. with the serviceHandle and so on). Change-Id: I3b79c5323bce043c93326edf6d660ea4bde8522a Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp')
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
index 78626e85..ff09878e 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
@@ -122,7 +122,7 @@ static QBluetoothDeviceInfo createClassicDeviceInfo(const BLUETOOTH_DEVICE_INFO
}
static QBluetoothDeviceInfo findFirstClassicDevice(
- int *systemErrorCode, HBLUETOOTH_DEVICE_FIND *searchHandle)
+ int *systemErrorCode, HBLUETOOTH_DEVICE_FIND *hSearch)
{
BLUETOOTH_DEVICE_SEARCH_PARAMS searchParams;
::ZeroMemory(&searchParams, sizeof(searchParams));
@@ -144,7 +144,7 @@ static QBluetoothDeviceInfo findFirstClassicDevice(
QBluetoothDeviceInfo foundDevice;
if (hFind) {
- *searchHandle = hFind;
+ *hSearch = hFind;
*systemErrorCode = NO_ERROR;
foundDevice = createClassicDeviceInfo(deviceInfo);
} else {
@@ -155,14 +155,14 @@ static QBluetoothDeviceInfo findFirstClassicDevice(
}
static QBluetoothDeviceInfo findNextClassicDevice(
- int *systemErrorCode, HBLUETOOTH_DEVICE_FIND searchHandle)
+ int *systemErrorCode, HBLUETOOTH_DEVICE_FIND hSearch)
{
BLUETOOTH_DEVICE_INFO deviceInfo;
::ZeroMemory(&deviceInfo, sizeof(deviceInfo));
deviceInfo.dwSize = sizeof(deviceInfo);
QBluetoothDeviceInfo foundDevice;
- if (!::BluetoothFindNextDevice(searchHandle, &deviceInfo)) {
+ if (!::BluetoothFindNextDevice(hSearch, &deviceInfo)) {
*systemErrorCode = ::GetLastError();
} else {
*systemErrorCode = NO_ERROR;
@@ -172,11 +172,11 @@ static QBluetoothDeviceInfo findNextClassicDevice(
return foundDevice;
}
-static void closeClassicSearch(HBLUETOOTH_DEVICE_FIND *searchHandle)
+static void closeClassicSearch(HBLUETOOTH_DEVICE_FIND *hSearch)
{
- if (searchHandle && *searchHandle) {
- ::BluetoothFindDeviceClose(*searchHandle);
- *searchHandle = 0;
+ if (hSearch && *hSearch) {
+ ::BluetoothFindDeviceClose(*hSearch);
+ *hSearch = 0;
}
}
@@ -301,7 +301,7 @@ QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate(
, scanWatcher(Q_NULLPTR)
, active(false)
, systemErrorCode(NO_ERROR)
- , searchHandle(0)
+ , hSearch(0)
, q_ptr(parent)
{
scanWatcher = new QFutureWatcher<QBluetoothDeviceInfo>(this);
@@ -368,7 +368,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start()
// Start scan for first classic device.
const QFuture<QBluetoothDeviceInfo> future = QtConcurrent::run(
- findFirstClassicDevice, &systemErrorCode, &searchHandle);
+ findFirstClassicDevice, &systemErrorCode, &hSearch);
scanWatcher->setFuture(future);
}
@@ -386,17 +386,17 @@ void QBluetoothDeviceDiscoveryAgentPrivate::taskFinished()
Q_Q(QBluetoothDeviceDiscoveryAgent);
if (pendingCancel && !pendingStart) {
- closeClassicSearch(&searchHandle);
+ closeClassicSearch(&hSearch);
active = false;
pendingCancel = false;
emit q->canceled();
} else if (pendingStart) {
- closeClassicSearch(&searchHandle);
+ closeClassicSearch(&hSearch);
pendingStart = pendingCancel = false;
start();
} else {
if (systemErrorCode == ERROR_NO_MORE_ITEMS) {
- closeClassicSearch(&searchHandle);
+ closeClassicSearch(&hSearch);
// Enumerate LE devices.
const QList<QBluetoothDeviceInfo> foundDevices =
enumerateLeDevices(&systemErrorCode);
@@ -418,10 +418,10 @@ void QBluetoothDeviceDiscoveryAgentPrivate::taskFinished()
processDiscoveredDevice(scanWatcher->result());
// Start scan for next classic device.
const QFuture<QBluetoothDeviceInfo> future = QtConcurrent::run(
- findNextClassicDevice, &systemErrorCode, searchHandle);
+ findNextClassicDevice, &systemErrorCode, hSearch);
scanWatcher->setFuture(future);
} else {
- closeClassicSearch(&searchHandle);
+ closeClassicSearch(&hSearch);
pendingStart = pendingCancel = false;
active = false;
lastError = (systemErrorCode == ERROR_INVALID_HANDLE) ?