summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer/connman/qconnmanservice_linux.cpp
diff options
context:
space:
mode:
authorSérgio Martins <sergio.martins@kdab.com>2015-07-01 17:23:10 +0100
committerMarc Mutz <marc.mutz@kdab.com>2015-07-04 06:03:21 +0000
commitebe4ab04ca156c64a5c56a6fca877654b451fe3d (patch)
tree83cf0a47657c2d3deadca672661358fb34d9cd77 /src/plugins/bearer/connman/qconnmanservice_linux.cpp
parent0698f876ca02b85c1e584b72cac3444796f6a355 (diff)
Use const-ref in foreach if T is big or non-trivial
Criteria: Linux x86_64, sizeof(T) > 8 Change-Id: I78c2b776ff219fa1ff6632fde17ae25fae66c54e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/plugins/bearer/connman/qconnmanservice_linux.cpp')
-rw-r--r--src/plugins/bearer/connman/qconnmanservice_linux.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
index d23d6e5f88..10d8285a4a 100644
--- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp
+++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
@@ -174,11 +174,10 @@ void QConnmanManagerInterface::connectNotify(const QMetaMethod &signal)
void QConnmanManagerInterface::onServicesChanged(const ConnmanMapList &changed, const QList<QDBusObjectPath> &removed)
{
- ConnmanMap connmanobj;
servicesList.clear(); //connman list changes order
- Q_FOREACH (connmanobj, changed) {
+ Q_FOREACH (const ConnmanMap &connmanobj, changed) {
const QString svcPath(connmanobj.objectPath.path());
- servicesList << svcPath;
+ servicesList << svcPath;
}
Q_EMIT servicesChanged(changed, removed);
@@ -220,7 +219,7 @@ QStringList QConnmanManagerInterface::getTechnologies()
QDBusPendingReply<ConnmanMapList> reply = call(QLatin1String("GetTechnologies"));
reply.waitForFinished();
if (!reply.isError()) {
- Q_FOREACH (ConnmanMap map, reply.value()) {
+ Q_FOREACH (const ConnmanMap &map, reply.value()) {
if (!technologiesMap.contains(map.objectPath.path())) {
technologyAdded(map.objectPath, map.propertyMap);
}
@@ -236,7 +235,7 @@ QStringList QConnmanManagerInterface::getServices()
QDBusPendingReply<ConnmanMapList> reply = call(QLatin1String("GetServices"));
reply.waitForFinished();
if (!reply.isError()) {
- Q_FOREACH (ConnmanMap map, reply.value()) {
+ Q_FOREACH (const ConnmanMap &map, reply.value()) {
servicesList << map.objectPath.path();
}
}