Use range loop if possible
Summary: It (should) simplify code a bit. It some cases prevents copying strings, shared_ptrs.
Reviewers: Kate, cullmann
Reviewed By: Kate, cullmann
Subscribers: cullmann, kwrite-devel, Kate
Tags: Kate
Differential Revision: https://phabricator.kde.org/D23010