Start: modernize C++: use range-based for loop

This commit is contained in:
wmayer
2023-08-15 12:57:12 +02:00
committed by wwmayer
parent 28a0274c7d
commit f24ada3151
2 changed files with 15 additions and 12 deletions

View File

@@ -65,11 +65,12 @@ void StartGui::Workbench::loadStartPage()
// Ensure that we don't open the Start page multiple times
QString title = QCoreApplication::translate("Workbench", "Start page");
QList<QWidget*> ch = Gui::getMainWindow()->windows();
for (QList<QWidget*>::const_iterator c = ch.cbegin(); c != ch.cend(); ++c) {
if ((*c)->windowTitle() == title) {
Gui::MDIView* mdi = qobject_cast<Gui::MDIView*>((*c));
if (mdi)
for (auto c : ch) {
if (c->windowTitle() == title) {
Gui::MDIView* mdi = qobject_cast<Gui::MDIView*>(c);
if (mdi) {
Gui::getMainWindow()->setActiveWindow(mdi);
}
return;
}
}