Replace Q_FOREACH with C++11 range-for

Authored by jeanv on Jul 20 2017, 2:14 PM.

Description

Replace Q_FOREACH with C++11 range-for

Summary:
The use of Q_FOREACH is advised against (https://doc.qt.io/qt-5/qtglobal.html#Q_FOREACH) since Qt 5.7 and will eventually be removed from Qt.

I replaced all occurrences with the range-for loop introduced in C++11 (except for the one in daemon.cpp in deviceIdByName which might have a bug / typo in it).

I added const to the container or casted it with qAsConst when appropriate to avoid unnecessary copies.

(This is my first submission. I did all the unit tests, and they all passed but I don't know how to show it here.)

Reviewers: KDE Connect, nicolasfella, apol

Reviewed By: KDE Connect, nicolasfella, apol

Subscribers: albertvaka, apol, nicolasfella

Tags: KDE Connect

Differential Revision: https://phabricator.kde.org/D6724

Details

Committed
albertvakaJul 21 2017, 7:57 AM
Reviewer
KDE Connect
Differential Revision
D6724: Replace Q_FOREACH with C++11 range-for
Parents
R224:aa307803296c: SVN_SILENT made messages (.desktop file) - always resolve ours
Branches
Unknown
Tags
Unknown