Commit 4915766b authored by Alexander Lohnau's avatar Alexander Lohnau 💬

Solve some clazy warnings

parent 5133d545
......@@ -221,7 +221,8 @@ void AppMenuModel::updateApplicationMenu(const QString &serviceName, const QStri
}
//cache first layer of sub menus, which we'll be popping up
for(QAction *a: m_menu->actions()) {
const auto actions = m_menu->actions();
for(QAction *a: actions) {
// signal dataChanged when the action changes
connect(a, &QAction::changed, this, [this, a] {
if (m_menuAvailable && m_menu) {
......@@ -253,7 +254,7 @@ void AppMenuModel::updateApplicationMenu(const QString &serviceName, const QStri
const auto actions = m_menu->actions();
auto it = std::find(actions.begin(), actions.end(), action);
if (it != actions.end()) {
requestActivateIndex(it - actions.begin());
Q_EMIT requestActivateIndex(it - actions.begin());
}
});
}
......@@ -294,7 +294,7 @@ void IconApplet::setUrl(const QUrl &url)
{
if (m_url != url) {
m_url = url;
urlChanged(url);
Q_EMIT urlChanged(url);
config().writeEntry(QStringLiteral("url"), url);
......@@ -349,7 +349,7 @@ QList<QAction *> IconApplet::contextualActions()
action->setSeparator(true);
}
connect(action, &QAction::triggered, this, [this, serviceAction]() {
connect(action, &QAction::triggered, this, [serviceAction]() {
auto *job = new KIO::ApplicationLauncherJob(serviceAction);
auto *delegate = new KNotificationJobUiDelegate(KJobUiDelegate::AutoErrorHandlingEnabled);
job->setUiDelegate(delegate);
......
......@@ -254,8 +254,8 @@ int PlaceholderModel::separatorCount() const
void PlaceholderModel::reset()
{
emit beginResetModel();
emit endResetModel();
beginResetModel();
endResetModel();
emit countChanged();
emit separatorCountChanged();
}
......
......@@ -306,7 +306,7 @@ void RootModel::refresh()
}
};
for (AbstractEntry *entry : m_entryList) {
for (AbstractEntry *entry : qAsConst(m_entryList)) {
processEntry(entry);
}
......
......@@ -467,7 +467,7 @@ void BackgroundListModel::setPendingDeletion(int rowIndex, bool pendingDeletion)
const QStringList BackgroundListModel::wallpapersAwaitingDeletion()
{
QStringList candidates;
for (const KPackage::Package &b : m_packages) {
for (const KPackage::Package &b : qAsConst(m_packages)) {
const QUrl wallpaperUrl = QUrl::fromLocalFile(b.filePath("preferred"));
if (m_pendingDeletion.contains(wallpaperUrl.toLocalFile()) && m_pendingDeletion[wallpaperUrl.toLocalFile()]) {
candidates << wallpaperUrl.toLocalFile();
......
......@@ -444,7 +444,7 @@ void Image::removeSlidePath(const QString &path)
if (m_slideshowModel) {
bool haveParent = false;
QStringList children;
for (const QString& slidePath : m_slidePaths) {
for (const QString& slidePath : qAsConst(m_slidePaths)) {
if (path.startsWith(slidePath)) {
haveParent = true;
}
......@@ -736,7 +736,8 @@ void Image::wallpaperBrowseCompleted()
{
Q_ASSERT(m_model);
if (m_dialog && m_dialog->selectedFiles().count() > 0) {
for (const QString image : m_dialog->selectedFiles()) {
const QStringList selectedFiles = m_dialog->selectedFiles();
for (const QString &image : selectedFiles) {
addUsersWallpaper(image);
}
emit customWallpaperPicked(m_dialog->selectedFiles().first());
......
Markdown is supported
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