Fix regression (fails to build from source) when building against Qt <= 5.7.

Review Request #128868 - Created Sept. 9, 2016 and discarded

Information
Johan Ouwerkerk
gwenview
master
Reviewers
gwenview
gladhorn, ivan

The qAsConst() macro is not available in Qt prior to 5.7, so manually use a const-ref to the container to get the desired behaviour.
(The goal is to avoid detaching of the container).

Note that if the use of if-defs is considered too ugly, there are the following alternatives:
- Revert to using Q_FOREACH() as is done right below the ranged-for loop in the same function anyway
- Use the manual const-ref version and drop the qAsConst() variant entirely.
- If the container is only ever accessed from the same thread, ignore the issue and don't bother with the const-ref (because then there shouldn't be any detaching anyway in this code).
- Bump the required Qt version to >= 5.7

Built with kdesrc-build against Qt 5.6.x on Debian (Unstable/Sid).

Johan Ouwerkerk
Johan Ouwerkerk
Johan Ouwerkerk
Johan Ouwerkerk
Albert Astals Cid
Johan Ouwerkerk
Review request changed

Status: Discarded

Loading...