[knewstuff] make it compile without foreach
Summary: compile without foreach
Test Plan: autotest ok
Reviewers: dfaure, apol, leinir
Reviewed By: apol, leinir
Subscribers: leinir, kde-frameworks-devel
Tags: Frameworks
Differential Revision: https://phabricator.kde.org/D19672