Commit d38b71ba authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use std::as_const

parent 93bc9d6f
Pipeline #157235 passed with stage
in 1 minute and 21 seconds
......@@ -90,7 +90,7 @@ void KDEDAccounts::accountCreated(const Accounts::AccountId id)
const Accounts::Account *acc = KAccounts::accountsManager()->account(id);
const Accounts::ServiceList services = acc->enabledServices();
for (KAccountsDPlugin *plugin : qAsConst(m_plugins)) {
for (KAccountsDPlugin *plugin : std::as_const(m_plugins)) {
plugin->onAccountCreated(id, services);
}
}
......@@ -99,7 +99,7 @@ void KDEDAccounts::accountRemoved(const Accounts::AccountId id)
{
qDebug() << id;
for (KAccountsDPlugin *plugin : qAsConst(m_plugins)) {
for (KAccountsDPlugin *plugin : std::as_const(m_plugins)) {
plugin->onAccountRemoved(id);
}
}
......@@ -116,11 +116,11 @@ void KDEDAccounts::enabledChanged(const QString &serviceName, bool enabled)
const Accounts::Service service = KAccounts::accountsManager()->service(serviceName);
if (!enabled) {
for (KAccountsDPlugin *plugin : qAsConst(m_plugins)) {
for (KAccountsDPlugin *plugin : std::as_const(m_plugins)) {
plugin->onServiceDisabled(accId, service);
}
} else {
for (KAccountsDPlugin *plugin : qAsConst(m_plugins)) {
for (KAccountsDPlugin *plugin : std::as_const(m_plugins)) {
plugin->onServiceEnabled(accId, service);
}
}
......
......@@ -123,7 +123,7 @@ void ServicesModel::setAccount(QObject *account)
connect(d->account, &Accounts::Account::displayNameChanged, this, &ServicesModel::accountChanged);
connect(d->account, &Accounts::Account::enabledChanged, this, [this](const QString &serviceName, bool /*enabled*/) {
int i{0};
for (const Accounts::Service &service : qAsConst(d->services)) {
for (const Accounts::Service &service : std::as_const(d->services)) {
if (service.name() == serviceName) {
break;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment