Skip to content

Commit

Permalink
Replace qAsConst with std::as_const
Browse files Browse the repository at this point in the history
  • Loading branch information
plfiorini committed Jul 5, 2024
1 parent a2d029d commit f905d1b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/daemon/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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\"",
Expand Down Expand Up @@ -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<QObject *>(module);
const auto name = m_pluginRegistry->getNameForInstance(instance);

Expand Down
2 changes: 1 addition & 1 deletion src/manager/backends/logind/logind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ bool LogindPrivate::getUserSession(DBusUserSession &session) const
// existing session for the user.
bool found = false;
DBusUserSessionVector sessions = qdbus_cast<DBusUserSessionVector>(reply.value().value<QDBusArgument>());
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());

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/session/autostart/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit f905d1b

Please sign in to comment.