diff --git a/src/deleted.cpp b/src/deleted.cpp index 5af1f91172..b427871807 100644 --- a/src/deleted.cpp +++ b/src/deleted.cpp @@ -108,7 +108,7 @@ void Deleted::copyToDeleted(Window *window) m_caption = window->caption(); for (auto vd : qAsConst(m_desktops)) { - connect(vd, &QObject::destroyed, this, [=] { + connect(vd, &QObject::destroyed, this, [=, this] { m_desktops.removeOne(vd); }); } diff --git a/src/effects/screenshot/screenshotdbusinterface2.cpp b/src/effects/screenshot/screenshotdbusinterface2.cpp index c1cf8ec60e..d0c6bd9910 100644 --- a/src/effects/screenshot/screenshotdbusinterface2.cpp +++ b/src/effects/screenshot/screenshotdbusinterface2.cpp @@ -456,7 +456,7 @@ QVariantMap ScreenShotDBusInterface2::CaptureInteractive(uint kind, const QDBusMessage replyMessage = message(); if (kind == 0) { - effects->startInteractiveWindowSelection([=](EffectWindow *window) { + effects->startInteractiveWindowSelection([=, this](EffectWindow *window) { effects->hideOnScreenMessage(EffectsHandler::OnScreenMessageHideFlag::SkipsCloseAnimation); if (!window) { @@ -473,7 +473,7 @@ QVariantMap ScreenShotDBusInterface2::CaptureInteractive(uint kind, "Escape or right click to cancel."), QStringLiteral("spectacle")); } else { - effects->startInteractivePositionSelection([=](const QPoint &point) { + effects->startInteractivePositionSelection([=, this](const QPoint &point) { effects->hideOnScreenMessage(EffectsHandler::OnScreenMessageHideFlag::SkipsCloseAnimation); if (point == QPoint(-1, -1)) { diff --git a/src/kcmkwin/common/effectsmodel.cpp b/src/kcmkwin/common/effectsmodel.cpp index 765a64c453..a7e9597252 100644 --- a/src/kcmkwin/common/effectsmodel.cpp +++ b/src/kcmkwin/common/effectsmodel.cpp @@ -449,7 +449,7 @@ void EffectsModel::load(LoadOptions options) const int serial = ++m_lastSerial; QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(interface.areEffectsSupported(effectNames), this); - connect(watcher, &QDBusPendingCallWatcher::finished, this, [=](QDBusPendingCallWatcher *self) { + connect(watcher, &QDBusPendingCallWatcher::finished, this, [=, this](QDBusPendingCallWatcher *self) { self->deleteLater(); if (m_lastSerial != serial) { diff --git a/src/kcmkwin/kwindecoration/kcm.cpp b/src/kcmkwin/kwindecoration/kcm.cpp index b71c6bca76..c5d369ba43 100644 --- a/src/kcmkwin/kwindecoration/kcm.cpp +++ b/src/kcmkwin/kwindecoration/kcm.cpp @@ -70,7 +70,7 @@ KCMKWinDecoration::KCMKWinDecoration(QObject *parent, const QVariantList &argume connect(this, &KCMKWinDecoration::borderSizeChanged, this, &KCMKWinDecoration::borderIndexChanged); connect(this, &KCMKWinDecoration::themeChanged, this, &KCMKWinDecoration::borderIndexChanged); - connect(this, &KCMKWinDecoration::themeChanged, this, [=]() { + connect(this, &KCMKWinDecoration::themeChanged, this, [this]() { if (m_data->settings()->borderSizeAuto()) { setBorderSize(recommendedBorderSize()); } diff --git a/src/wayland/appmenu_interface.cpp b/src/wayland/appmenu_interface.cpp index 50e8080523..d84759e5f3 100644 --- a/src/wayland/appmenu_interface.cpp +++ b/src/wayland/appmenu_interface.cpp @@ -42,7 +42,7 @@ void AppMenuManagerInterfacePrivate::org_kde_kwin_appmenu_manager_create(Resourc auto appmenu = new AppMenuInterface(s, appmenu_resource); appmenus.append(appmenu); - QObject::connect(appmenu, &QObject::destroyed, q, [=]() { + QObject::connect(appmenu, &QObject::destroyed, q, [=, this]() { appmenus.removeOne(appmenu); }); Q_EMIT q->appMenuCreated(appmenu);