summaryrefslogtreecommitdiffstats
path: root/core/btdiscovery.cpp
diff options
context:
space:
mode:
authorGravatar Rolf Eike Beer <eike@sf-mail.de>2019-04-01 22:15:19 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-12 12:59:17 +0300
commitc4c8094e32ad78dee558a80584470172f48c45b1 (patch)
tree4fede2acf0f1a3cee2182d96b1b3efa33e4fd8ff /core/btdiscovery.cpp
parent2b9ca488fd18dc9d65d42dc5900e120a07e5b3f6 (diff)
downloadsubsurface-c4c8094e32ad78dee558a80584470172f48c45b1.tar.gz
get rid of some foreach and Q_FOREACH constructs
See https://www.kdab.com/goodbye-q_foreach/ This is reduced to the places where the container is const or can be made const without the need to always introduce an extra variable. Sadly qAsConst (Qt 5.7) and std::as_const (C++17) are not available in all supported setups. Also do some minor cleanups along the way. Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
Diffstat (limited to 'core/btdiscovery.cpp')
-rw-r--r--core/btdiscovery.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp
index 3ef0273fe..7e75994da 100644
--- a/core/btdiscovery.cpp
+++ b/core/btdiscovery.cpp
@@ -198,8 +198,8 @@ void BTDiscovery::btDeviceDiscovered(const QBluetoothDeviceInfo &device)
this_d.name = device.name();
btPairedDevices.append(this_d);
- QList<QBluetoothUuid> serviceUuids = device.serviceUuids();
- foreach (QBluetoothUuid id, serviceUuids) {
+ const auto serviceUuids = device.serviceUuids();
+ for (QBluetoothUuid id: serviceUuids) {
addBtUuid(id);
qDebug() << id.toByteArray();
}