summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2017-06-01 16:56:23 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2017-06-07 17:47:42 +0000
commit5c62cfd89db15229fa9a96825c04ad6b6fd08db9 (patch)
treea3874fb237a9b92e238739d819b25c1782e8d28e /src
parentf02932a14e902a5a4cd7f3fe34c85ddb636e6044 (diff)
Replace 'foreach' macro with range-based 'for'
Change-Id: I7010ff54a146a9d70029e2607b415e0e1dcc1d78 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp5
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_win.cpp3
-rw-r--r--src/bluetooth/qlowenergycontroller_win.cpp6
3 files changed, 7 insertions, 7 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
index 9f3eb84c..7f0fe728 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_win.cpp
@@ -406,10 +406,9 @@ void QBluetoothDeviceDiscoveryAgentPrivate::taskFinished()
if (systemErrorCode == ERROR_NO_MORE_ITEMS) {
closeClassicSearch(&hSearch);
// Enumerate LE devices.
- const QList<QBluetoothDeviceInfo> foundDevices =
- enumerateLeDevices(&systemErrorCode);
+ const QList<QBluetoothDeviceInfo> foundDevices = enumerateLeDevices(&systemErrorCode);
if (systemErrorCode == ERROR_NO_MORE_ITEMS) {
- foreach (const QBluetoothDeviceInfo &foundDevice, foundDevices)
+ for (const QBluetoothDeviceInfo &foundDevice : foundDevices)
processDiscoveredDevice(foundDevice);
active = false;
emit q->finished();
diff --git a/src/bluetooth/qbluetoothlocaldevice_win.cpp b/src/bluetooth/qbluetoothlocaldevice_win.cpp
index 816a3a4b..78b82a97 100644
--- a/src/bluetooth/qbluetoothlocaldevice_win.cpp
+++ b/src/bluetooth/qbluetoothlocaldevice_win.cpp
@@ -199,7 +199,8 @@ void QBluetoothLocalDevicePrivate::initialize(const QBluetoothAddress &address)
{
Q_Q(QBluetoothLocalDevice);
- foreach (const QBluetoothHostInfo &adapterInfo, QBluetoothLocalDevicePrivate::localAdapters()) {
+ const QList<QBluetoothHostInfo> adapterInfos = QBluetoothLocalDevicePrivate::localAdapters();
+ for (const QBluetoothHostInfo &adapterInfo : adapterInfos) {
if (address == QBluetoothAddress()
|| address == adapterInfo.address()) {
deviceAddress = adapterInfo.address();
diff --git a/src/bluetooth/qlowenergycontroller_win.cpp b/src/bluetooth/qlowenergycontroller_win.cpp
index f01b99d7..494d715c 100644
--- a/src/bluetooth/qlowenergycontroller_win.cpp
+++ b/src/bluetooth/qlowenergycontroller_win.cpp
@@ -723,7 +723,7 @@ void QLowEnergyControllerPrivate::discoverServices()
Q_Q(QLowEnergyController);
- foreach (const BTH_LE_GATT_SERVICE &service, foundServices) {
+ for (const BTH_LE_GATT_SERVICE &service : foundServices) {
const QBluetoothUuid uuid = qtBluetoothUuidFromNativeLeUuid(
service.ServiceUuid);
qCDebug(QT_BT_WINDOWS) << "Found uuid:" << uuid;
@@ -784,7 +784,7 @@ void QLowEnergyControllerPrivate::discoverServiceDetails(
return;
}
- foreach (const BTH_LE_GATT_CHARACTERISTIC &gattCharacteristic, foundCharacteristics) {
+ for (const BTH_LE_GATT_CHARACTERISTIC &gattCharacteristic : foundCharacteristics) {
const QLowEnergyHandle characteristicHandle = gattCharacteristic.AttributeHandle;
QLowEnergyServicePrivate::CharData detailsData;
@@ -850,7 +850,7 @@ void QLowEnergyControllerPrivate::discoverServiceDetails(
}
}
- foreach (const BTH_LE_GATT_DESCRIPTOR &gattDescriptor, foundDescriptors) {
+ for (const BTH_LE_GATT_DESCRIPTOR &gattDescriptor : foundDescriptors) {
const QLowEnergyHandle descriptorHandle = gattDescriptor.AttributeHandle;
QLowEnergyServicePrivate::DescData data;