Commit bac3973f authored by Raine Makelainen's avatar Raine Makelainen

Use for range loop for the rest of the libconnman-qt

parent 9d9fd13e
......@@ -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());
......
......@@ -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);
......
......@@ -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")) {
......
......@@ -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]);
}
......
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment