Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use for range loop for the rest of the libconnman-qt
  • Loading branch information
rainemak committed Jun 28, 2018
1 parent 9d9fd13 commit bac3973
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions libconnman-qt/connmannetworkproxyfactory.cpp
Expand Up @@ -59,12 +59,12 @@ void ConnmanNetworkProxyFactory::onProxyChanged(const QVariantMap &proxy)
}
} else if (proxy.value("Method").toString() == QLatin1String("manual")) {
const QStringList proxyUrlStrings = proxy.value("Servers").toStringList();
Q_FOREACH (const QString &proxyUrlString, proxyUrlStrings) {
for (const QString &proxyUrlString : proxyUrlStrings) {
proxyUrls.append(QUrl(proxyUrlString));
}
}

Q_FOREACH (const QUrl &url, proxyUrls) {
for (const QUrl &url : proxyUrls) {
if (url.scheme() == QLatin1String("socks5")) {
QNetworkProxy proxy(QNetworkProxy::Socks5Proxy, url.host(),
url.port() ? url.port() : 1080, url.userName(), url.password());
Expand Down
4 changes: 2 additions & 2 deletions libconnman-qt/networkservice.cpp
Expand Up @@ -722,10 +722,10 @@ void NetworkService::Private::updateManaged()
QVariantMap NetworkService::Private::adaptToConnmanProperties(const QVariantMap &map)
{
QVariantMap buffer;
Q_FOREACH (const QString &key, map.keys()) {
for (const QString &key : map.keys()) {
if (map.value(key).type() == QVariant::List) {
QStringList strList;
Q_FOREACH (const QVariant &value, map.value(key).toList()) {
for (const QVariant &value : map.value(key).toList()) {
strList.append(value.toString());
}
buffer.insert(key, strList);
Expand Down
2 changes: 1 addition & 1 deletion libconnman-qt/networksession.cpp
Expand Up @@ -102,7 +102,7 @@ void NetworkSession::requestDisconnect()

void NetworkSession::sessionSettingsUpdated(const QVariantMap &settings)
{
Q_FOREACH(const QString &name, settings.keys()) {
for (const QString &name : settings.keys()) {
settingsMap.insert(name,settings[name]);

if (name == QLatin1String("State")) {
Expand Down
2 changes: 1 addition & 1 deletion libconnman-qt/networktechnology.cpp
Expand Up @@ -82,7 +82,7 @@ void NetworkTechnology::getPropertiesFinished(QDBusPendingCallWatcher *call)

if (!reply.isError()) {
QVariantMap tmpCache = reply.value();
Q_FOREACH(const QString &name, tmpCache.keys()) {
for (const QString &name : tmpCache.keys()) {
m_propertiesCache.insert(name, tmpCache[name]);
emitPropertyChange(name, tmpCache[name]);
}
Expand Down
2 changes: 1 addition & 1 deletion libconnman-qt/useragent.cpp
Expand Up @@ -205,7 +205,7 @@ void AgentAdaptor::RequestInput(const QDBusObjectPath &service_path,
const QDBusMessage &message)
{
QVariantMap json;
Q_FOREACH (const QString &key, fields.keys()){
for (const QString &key : fields.keys()){
QVariantMap payload = qdbus_cast<QVariantMap>(fields[key]);
json.insert(key, payload);
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/savedservicemodel.cpp
Expand Up @@ -148,7 +148,7 @@ int SavedServiceModel::indexOf(const QString &dbusObjectPath) const
{
int idx(-1);

Q_FOREACH (NetworkService *service, m_services) {
for (NetworkService *service : m_services) {
idx++;
if (service->path() == dbusObjectPath) return idx;
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/technologymodel.cpp
Expand Up @@ -247,7 +247,7 @@ int TechnologyModel::indexOf(const QString &dbusObjectPath) const
{
int idx(-1);

Q_FOREACH (NetworkService *service, m_services) {
for (const NetworkService *service : m_services) {
idx++;
if (service->path() == dbusObjectPath) return idx;
}
Expand Down

0 comments on commit bac3973

Please sign in to comment.