Future proof the code for C++20

warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20
This commit is contained in:
Albert Astals Cid 2022-10-14 14:28:53 +02:00 committed by Vlad Zahorodnii
parent 186ef5e588
commit 19694fb046
5 changed files with 6 additions and 6 deletions

View file

@ -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);
});
}

View file

@ -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)) {

View file

@ -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) {

View file

@ -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());
}

View file

@ -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);