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