Skip to content

Commit

Permalink
Modernize for loops
Browse files Browse the repository at this point in the history
  • Loading branch information
pvuorela committed Jun 21, 2018
1 parent 9e363ef commit cd16d18
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/developermodesettings.cpp
Expand Up @@ -72,8 +72,8 @@ static QMap<QString,QString> enumerate_network_interfaces()
{
QMap<QString,QString> result;

foreach (const QNetworkInterface &intf, QNetworkInterface::allInterfaces()) {
foreach (const QNetworkAddressEntry &entry, intf.addressEntries()) {
for (const QNetworkInterface &intf : QNetworkInterface::allInterfaces()) {
for (const QNetworkAddressEntry &entry : intf.addressEntries()) {
if (entry.ip().protocol() == QAbstractSocket::IPv4Protocol) {
result[intf.name()] = entry.ip().toString();
}
Expand Down Expand Up @@ -213,10 +213,8 @@ void DeveloperModeSettings::refresh()
}
}

foreach (const QString &device, entries.keys()) {
QString ip = entries[device];
qCDebug(lcDeveloperModeLog) << "Device:" << device
<< "IP:" << ip;
for (const QString &device : entries.keys()) {
qCDebug(lcDeveloperModeLog) << "Device:" << device << "IP:" << entries[device];
}
}

Expand Down

0 comments on commit cd16d18

Please sign in to comment.