[pim/trojita] src/Gui: Refactor Q_FOREACH to range based for loop

Espen Sandøy Hustad <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit cae930b4f346d961a5514a6e84df1bcbf00da047 by Espen Sandøy Hustad.
Committed on 03/08/2026 at 18:32.
Pushed by ehustad into branch 'master'.

Refactor Q_FOREACH to range based for loop

M  +3    -2    src/Gui/Window.cpp

https://invent.kde.org/pim/trojita/-/commit/cae930b4f346d961a5514a6e84df1bcbf00da047

diff --git a/src/Gui/Window.cpp b/src/Gui/Window.cpp
index 15e559d86..eff9b64a5 100644
--- a/src/Gui/Window.cpp
+++ b/src/Gui/Window.cpp
@@ -2167,8 +2167,9 @@ void MainWindow::slotShowAboutTrojita()
         // Find the names of the authors and remove date codes from there
         QFile license(QStringLiteral(":/LICENSE"));
         license.open(QFile::ReadOnly);
-        const QString prefix(QStringLiteral("Copyright (C) "));
-        Q_FOREACH(const QString &line, QString::fromUtf8(license.readAll()).split(QLatin1Char('\n'))) {
+        const auto copyrightHolders = QString::fromUtf8(license.readAll()).split(QLatin1Char('\n'));
+        for (const auto &line : std::as_const(copyrightHolders)) {
+            const QString prefix(QStringLiteral("Copyright (C) "));
             if (line.startsWith(prefix)) {
                 const int pos = prefix.size();
                 copyright << QChar(0xa9 /* COPYRIGHT SIGN */) + QLatin1Char(' ') +
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.