Commit befcc738 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

clazy: Avoid detaching of temporaries and in for loops

parent 17bb9a8e
......@@ -132,7 +132,7 @@ void Dtime::currentZone()
m_local->setText(i18nc("%1 is name of time zone, %2 is its abbreviation",
"Current local time zone: %1 (%2)",
K4TimeZoneWidget::displayName(localZone),
QString::fromUtf8(localZone.abbreviations().first())));
QString::fromUtf8(localZone.abbreviations().constFirst())));
}
}
......
......@@ -49,7 +49,7 @@ KclockModule::KclockModule(QWidget *parent, const QVariantList &)
QStringLiteral("org.freedesktop.DBus"),
QStringLiteral("ListActivatableNames")));
if (!reply.arguments().isEmpty() && reply.arguments().first().value<QStringList>().contains(QLatin1String("org.freedesktop.timedate1"))) {
if (!reply.arguments().isEmpty() && reply.arguments().constFirst().value<QStringList>().contains(QLatin1String("org.freedesktop.timedate1"))) {
m_haveTimedated = true;
}
......
......@@ -85,7 +85,7 @@ QList<KPackage::Package> KCMSplashScreen::availablePackages(const QString &compo
paths << dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
}
for (const QString &path : paths) {
for (const QString &path : qAsConst(paths)) {
KPackage::Package pkg = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/LookAndFeel"));
pkg.setPath(path);
pkg.setFallbackPackage(KPackage::Package());
......
......@@ -150,7 +150,7 @@ KConfigGroup *ActionItem::configItem(DesktopAction actionType, GroupType keyGrou
if (isUserSupplied()) {
countAccess = 1;
}
return actionGroups.values(keyGroup)[countAccess];
return actionGroups.values(keyGroup).at(countAccess);
}
return actionGroups.values(keyGroup)[0]; // Implement a backstop so a valid value is always returned
return actionGroups.values(keyGroup).at(0); // Implement a backstop so a valid value is always returned
}
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