From f905d1b79afc2f278545975f72f171bce7582f34 Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Fri, 5 Jul 2024 06:08:14 +0200 Subject: [PATCH] Replace qAsConst with std::as_const --- src/daemon/daemon.cpp | 4 ++-- src/manager/backends/logind/logind.cpp | 2 +- src/plugins/session/autostart/plugin.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp index 103fbc8..f9b1ae8 100644 --- a/src/daemon/daemon.cpp +++ b/src/daemon/daemon.cpp @@ -125,7 +125,7 @@ void Daemon::start() return; // Start all modules - for (auto *module : qAsConst(m_modules)) { + for (auto *module : std::as_const(m_modules)) { auto name = m_pluginRegistry->getNameForInstance(module); if (!module) { qCWarning(lcDaemon, "Ignoring invalid session module \"%s\"", @@ -153,7 +153,7 @@ void Daemon::shutdown() // Stop modules std::reverse(m_loadedModules.begin(), m_loadedModules.end()); - for (auto *module : qAsConst(m_loadedModules)) { + for (auto *module : std::as_const(m_loadedModules)) { auto *instance = dynamic_cast(module); const auto name = m_pluginRegistry->getNameForInstance(instance); diff --git a/src/manager/backends/logind/logind.cpp b/src/manager/backends/logind/logind.cpp index f8e69ff..941f463 100644 --- a/src/manager/backends/logind/logind.cpp +++ b/src/manager/backends/logind/logind.cpp @@ -286,7 +286,7 @@ bool LogindPrivate::getUserSession(DBusUserSession &session) const // existing session for the user. bool found = false; DBusUserSessionVector sessions = qdbus_cast(reply.value().value()); - for (const auto &curSession : qAsConst(sessions)) { + for (const auto &curSession : std::as_const(sessions)) { const QString type = getSessionType(curSession.id, curSession.objectPath.path()); const QString state = getSessionState(curSession.id, curSession.objectPath.path()); diff --git a/src/plugins/session/autostart/plugin.cpp b/src/plugins/session/autostart/plugin.cpp index 10d0776..8dbaeb9 100644 --- a/src/plugins/session/autostart/plugin.cpp +++ b/src/plugins/session/autostart/plugin.cpp @@ -79,7 +79,7 @@ bool AutostartPlugin::stop() { std::reverse(m_desktopFiles.begin(), m_desktopFiles.end()); - for (const auto &fileName : qAsConst(m_desktopFiles)) { + for (const auto &fileName : std::as_const(m_desktopFiles)) { qCDebug(lcSession) << "Terminate autostart entry from" << fileName; terminateDesktopFile(fileName); }