Commit 03c5cd25 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Solve clazy warnings in applets

parent a2481a94
......@@ -127,7 +127,6 @@ void Kimpanel::updateLookupTableFull(const KimpanelLookupTable& lookupTable, int
m_labels.clear();
m_texts.clear();
Q_FOREACH(const KimpanelLookupTable::Entry & entry, lookupTable.entries) {
QVariantMap map;
m_labels << entry.label;
m_texts << entry.text;
}
......
......@@ -106,7 +106,7 @@ PagerModel::Private::Private(PagerModel *q)
QObject::connect(activityInfo, &ActivityInfo::currentActivityChanged, q,
[this]() {
if (pagerType == VirtualDesktops && windowModels.count()) {
for (auto windowModel : windowModels) {
for (auto windowModel : qAsConst(windowModels)) {
windowModel->setActivity(activityInfo->currentActivity());
}
}
......@@ -118,9 +118,10 @@ PagerModel::Private::Private(PagerModel *q)
auto configureScreen = [q](QScreen* screen) {
QObject::connect(screen, &QScreen::geometryChanged, q, &PagerModel::pagerItemSizeChanged);
q->pagerItemSizeChanged();
Q_EMIT q->pagerItemSizeChanged();
};
for (QScreen* screen : qGuiApp->screens()) {
const auto screens = qGuiApp->screens();
for (QScreen* screen : screens) {
configureScreen(screen);
}
QObject::connect(qGuiApp, &QGuiApplication::screenAdded, q, configureScreen);
......@@ -131,7 +132,7 @@ PagerModel::Private::Private(PagerModel *q)
[this]() {
cachedStackingOrder = KWindowSystem::stackingOrder();
for (auto windowModel : windowModels) {
for (auto windowModel : qAsConst(windowModels)) {
windowModel->refreshStackingOrder();
}
}
......@@ -434,7 +435,7 @@ void PagerModel::refresh()
if (d->pagerType == VirtualDesktops) {
int virtualDesktop = 0;
for (auto windowModel : d->windowModels) {
for (auto windowModel : qAsConst(d->windowModels)) {
windowModel->setVirtualDesktop(d->virtualDesktopInfo->desktopIds().at(virtualDesktop));
++virtualDesktop;
......@@ -444,7 +445,7 @@ void PagerModel::refresh()
int activityIndex = 0;
const QStringList &runningActivities = d->activityInfo->runningActivities();
for (auto windowModel : d->windowModels) {
for (auto windowModel : qAsConst(d->windowModels)) {
windowModel->setVirtualDesktop();
windowModel->setActivity(runningActivities.at(activityIndex));
......@@ -452,7 +453,7 @@ void PagerModel::refresh()
}
}
for (auto windowModel : d->windowModels) {
for (auto windowModel : qAsConst(d->windowModels)) {
if (d->showOnlyCurrentScreen && d->screenGeometry.isValid()) {
windowModel->setScreenGeometry(d->screenGeometry);
windowModel->setFilterByScreen(true);
......
......@@ -181,7 +181,7 @@ QVariantList Backend::jumpListActions(const QUrl &launcherUrl, QObject *parent)
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;
delegate->setAutoErrorHandlingEnabled(true);
......@@ -216,7 +216,7 @@ QVariantList Backend::systemSettingsActions(QObject *parent) const
return actions;
}
for (const QString &id : ids) {
for (const QString &id : qAsConst(ids)) {
KService::Ptr service = KService::serviceByStorageId(id);
if (!service || !service->isValid()) {
continue;
......@@ -226,7 +226,7 @@ QVariantList Backend::systemSettingsActions(QObject *parent) const
action->setText(service->name());
action->setIcon(QIcon::fromTheme(service->icon()));
connect(action, &QAction::triggered, this, [this, service]() {
connect(action, &QAction::triggered, this, [service]() {
auto *job = new KIO::ApplicationLauncherJob(service);
auto *delegate = new KNotificationJobUiDelegate;
delegate->setAutoErrorHandlingEnabled(true);
......
......@@ -1158,7 +1158,8 @@ void FolderModel::drop(QQuickItem *target, QObject* dropEvent, int row, bool sho
if (m_usedByContainment && !m_screenMapper->sharedDesktops()) {
if (isDropBetweenSharedViews(mimeData->urls(), dropTargetFolderUrl)) {
setSortMode(-1);
for (const auto &url : mimeData->urls()) {
const QList<QUrl> urls = mimeData->urls();
for (const auto &url : urls) {
m_dropTargetPositions.insert(url.fileName(), dropPos);
m_screenMapper->addMapping(mappableUrl(url), m_screen, ScreenMapper::DelayedSignal);
m_screenMapper->removeItemFromDisabledScreen(mappableUrl(url));
......@@ -1185,7 +1186,8 @@ void FolderModel::drop(QQuickItem *target, QObject* dropEvent, int row, bool sho
// The QMimeData we extract from the DropArea's drop event is deleted as soon as this method
// ends but we need to keep a copy for when popupMenuAboutToShow fires.
QMimeData *mimeCopy = new QMimeData();
for (const QString &format : mimeData->formats()) {
const QStringList formats = mimeData->formats();
for (const QString &format : formats) {
mimeCopy->setData(format, mimeData->data(format));
}
......
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