QXdgDesktopPortalFileDialog: fix C++20 build

In a lambda, capturing of `*this` by reference via `=` is deprecated,
and breaks the build. Capture everything needed instead.

Amends fb981a0954.

Change-Id: I5d3d192e71662b96154cb5979898277bd0720a90
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2022-06-17 17:33:37 +02:00
parent a7203a8920
commit 1c106b37c7

View File

@ -266,7 +266,7 @@ void QXdgDesktopPortalFileDialog::openPortal(Qt::WindowFlags windowFlags, Qt::Wi
QDBusPendingCall pendingCall = QDBusConnection::sessionBus().asyncCall(message);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingCall);
connect(watcher, &QDBusPendingCallWatcher::finished, this, [=] (QDBusPendingCallWatcher *watcher) {
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, d, windowFlags, windowModality, parent] (QDBusPendingCallWatcher *watcher) {
QDBusPendingReply<QDBusObjectPath> reply = *watcher;
// Any error means the dialog is not shown and we need to fallback
d->failedToOpen = reply.isError();