Fix more deprecated warnings: foreach and KMessage Box
Qt6 will forego the foreach macro so for switching to KF6+Qt6 the foreach constructs need to be fixed. KMessageBox::xxxYesNo has been deprecated already in KF5 5.100 -> update to the new KMessageBox::xxxTwoActions way of doing things
This is part of untangling my work for moving to Kf6, however this should compile and I think work with Kf5 as well.