diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-01-26 14:38:54 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-04-25 07:42:48 +0000 |
commit | 0d19a571cd5d5b031a91a4a3b4ad0a380989c47a (patch) | |
tree | 903092aa34df728c0b4d2397f33604ed2460c735 /src/plugins/bearer | |
parent | 3010c387132a54f81147d5b2c17d96b27f49fe0f (diff) |
Android: eradicate Q_FOREACH loops [rvalues]
... by replacing them with C++11 range-for loops.
This is the simplest of the patch series: Q_FOREACH took a
copy, so we do, too. Except we don't, since we're just
catching the return value that comes out of the function
(RVO). We can't feed the rvalues into range-for, because
they are non-const and would thus detach.
Change-Id: Ia086b1f3d072dd56c3545780490be03346df2880
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/plugins/bearer')
-rw-r--r-- | src/plugins/bearer/android/src/qandroidbearerengine.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/bearer/android/src/qandroidbearerengine.cpp b/src/plugins/bearer/android/src/qandroidbearerengine.cpp index e7a1d2b5fb..a43ed69570 100644 --- a/src/plugins/bearer/android/src/qandroidbearerengine.cpp +++ b/src/plugins/bearer/android/src/qandroidbearerengine.cpp @@ -275,7 +275,8 @@ void QAndroidBearerEngine::updateConfigurations() interfaces = QNetworkInterface::allInterfaces(); // Create a configuration for each of the main types (WiFi, Mobile, Bluetooth, WiMax, Ethernet) - foreach (const AndroidNetworkInfo &netInfo, m_connectivityManager->getAllNetworkInfo()) { + const auto netInfos = m_connectivityManager->getAllNetworkInfo(); + for (const AndroidNetworkInfo &netInfo : netInfos) { if (!netInfo.isValid()) continue; |