diff options
Diffstat (limited to 'src/bluetooth/bluez/bluez5_helper.cpp')
-rw-r--r-- | src/bluetooth/bluez/bluez5_helper.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bluetooth/bluez/bluez5_helper.cpp b/src/bluetooth/bluez/bluez5_helper.cpp index f798088e..2beb533c 100644 --- a/src/bluetooth/bluez/bluez5_helper.cpp +++ b/src/bluetooth/bluez/bluez5_helper.cpp @@ -331,7 +331,8 @@ QtBluezDiscoveryManager::~QtBluezDiscoveryManager() { qCDebug(QT_BT_BLUEZ) << "Destroying QtBluezDiscoveryManager"; - foreach (const QString &adapterPath, d->references.keys()) { + const QList<QString> adapterPaths = d->references.keys(); + for (const QString &adapterPath : adapterPaths) { AdapterData *data = d->references.take(adapterPath); delete data->propteryListener; @@ -416,7 +417,8 @@ void QtBluezDiscoveryManager::unregisterDiscoveryInterest(const QString &adapter // if (d->references.isEmpty()) { // qCDebug(QT_BT_BLUEZ) << "No running registration"; // } else { -// foreach (const QString &path, d->references.keys()) { +// const QList<QString> paths = d->references.keys(); +// for (const QString &path : paths) { // qCDebug(QT_BT_BLUEZ) << path << "->" << d->references[path]->reference; // } // } @@ -536,7 +538,7 @@ QString findAdapterForAddress(const QBluetoothAddress &wantedAddress, bool *ok = if (wantedAddress.isNull()) return localAdapters.front().first; // -> return first found adapter - foreach (const AddressForPathType &pair, localAdapters) { + for (const AddressForPathType &pair : qAsConst(localAdapters)) { if (pair.second == wantedAddress) return pair.first; // -> found local adapter with wanted address } |