Skip to content

Commit f905d1b

Browse files
committed
Replace qAsConst with std::as_const
1 parent a2d029d commit f905d1b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/daemon/daemon.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void Daemon::start()
125125
return;
126126

127127
// Start all modules
128-
for (auto *module : qAsConst(m_modules)) {
128+
for (auto *module : std::as_const(m_modules)) {
129129
auto name = m_pluginRegistry->getNameForInstance(module);
130130
if (!module) {
131131
qCWarning(lcDaemon, "Ignoring invalid session module \"%s\"",
@@ -153,7 +153,7 @@ void Daemon::shutdown()
153153

154154
// Stop modules
155155
std::reverse(m_loadedModules.begin(), m_loadedModules.end());
156-
for (auto *module : qAsConst(m_loadedModules)) {
156+
for (auto *module : std::as_const(m_loadedModules)) {
157157
auto *instance = dynamic_cast<QObject *>(module);
158158
const auto name = m_pluginRegistry->getNameForInstance(instance);
159159

src/manager/backends/logind/logind.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ bool LogindPrivate::getUserSession(DBusUserSession &session) const
286286
// existing session for the user.
287287
bool found = false;
288288
DBusUserSessionVector sessions = qdbus_cast<DBusUserSessionVector>(reply.value().value<QDBusArgument>());
289-
for (const auto &curSession : qAsConst(sessions)) {
289+
for (const auto &curSession : std::as_const(sessions)) {
290290
const QString type = getSessionType(curSession.id, curSession.objectPath.path());
291291
const QString state = getSessionState(curSession.id, curSession.objectPath.path());
292292

src/plugins/session/autostart/plugin.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ bool AutostartPlugin::stop()
7979
{
8080
std::reverse(m_desktopFiles.begin(), m_desktopFiles.end());
8181

82-
for (const auto &fileName : qAsConst(m_desktopFiles)) {
82+
for (const auto &fileName : std::as_const(m_desktopFiles)) {
8383
qCDebug(lcSession) << "Terminate autostart entry from" << fileName;
8484
terminateDesktopFile(fileName);
8585
}

0 commit comments

Comments
 (0)