XDG Portal: quick optimization to avoid dup/close of a file descriptor

Just gift it to QDBusUnixFileDescriptor.

Change-Id: Ifa822ecdaaa241968ed7fffd158799041653cf78
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This commit is contained in:
Thiago Macieira 2019-02-28 10:00:39 -08:00
parent 1bd3c17c46
commit f5cbd61f92

View File

@ -206,8 +206,8 @@ static inline QDBusMessage xdgDesktopPortalOpenFile(const QUrl &url)
QLatin1String("org.freedesktop.portal.OpenURI"),
QLatin1String("OpenFile"));
QDBusUnixFileDescriptor descriptor(fd);
qt_safe_close(fd);
QDBusUnixFileDescriptor descriptor;
descriptor.giveFileDescriptor(fd);
// FIXME parent_window_id and handle writable option
message << QString() << QVariant::fromValue(descriptor) << QVariantMap();