Port away from foreach()
Summary:
The macro is on its way to getting deprecated, so we better start
adopting the suggested alternative just as well.
Test Plan: plasmashell runs fine
Reviewers: Plasma, ngraham
Reviewed By: ngraham
Subscribers: plasma-devel
Tags: Plasma
Differential Revision: https://phabricator.kde.org/D21493