Remove foreach replace with newer style for loops
Signed-off-by: Chris Rizzitello <rizzitello@kde.org>