diff options
author | Jan Grulich <jgrulich@redhat.com> | 2020-09-24 09:59:04 +0200 |
---|---|---|
committer | Jan Grulich <jgrulich@redhat.com> | 2020-10-21 08:38:15 +0200 |
commit | 3e09ac369dc8e2851ff772b9d9dde92fffd959b2 (patch) | |
tree | a3d25de7c691910229996d452551a64be7f84780 /src/gui | |
parent | 2a5afb88dbf675c39e0671b11870596fdb3b6725 (diff) |
OpenFile portal: use "writable" option to specify our FD is writable
When using OpenFile portal and passing a file descriptor, we open the
file with qt_safe_open() which by defaults make the file descriptor
writable. However we didn't specify in options that the FD is writable
which leads into rejection on xdg-desktop-portal side as there is a
mismatch between writable FD and read-only request.
Pick-to: 5.15
Change-Id: I7a430339a9615f0a054e777e0f3de56e219d1706
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/platform/unix/qgenericunixservices.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/platform/unix/qgenericunixservices.cpp b/src/gui/platform/unix/qgenericunixservices.cpp index cd32cd2a0b..e7b9ae3368 100644 --- a/src/gui/platform/unix/qgenericunixservices.cpp +++ b/src/gui/platform/unix/qgenericunixservices.cpp @@ -214,8 +214,10 @@ static inline QDBusMessage xdgDesktopPortalOpenFile(const QUrl &url) QDBusUnixFileDescriptor descriptor; descriptor.giveFileDescriptor(fd); - // FIXME parent_window_id and handle writable option - message << QString() << QVariant::fromValue(descriptor) << QVariantMap(); + const QVariantMap options = {{QLatin1String("writable"), true}}; + + // FIXME parent_window_id + message << QString() << QVariant::fromValue(descriptor) << options; return QDBusConnection::sessionBus().call(message); } |