From 4c37b64411f60d2667963db8e7d42459cad663e6 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Thu, 18 Oct 2018 10:02:48 +0200 Subject: Add terminating character when sending byte arrays in FileChooser portal Terminating character is needed for gtk portal backend, which is not able to contruct a string without it and thus not able to pre-select a file or a directory in file dialog. Change-Id: I5b40fb1ce584936fc92e93f38dc8559890852d99 Reviewed-by: Thiago Macieira --- .../platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp index cda267d24b..5e94d1558e 100644 --- a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp +++ b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp @@ -181,10 +181,10 @@ void QXdgDesktopPortalFileDialog::openPortal() if (d->saveFile) { if (!d->directory.isEmpty()) - options.insert(QLatin1String("current_folder"), d->directory.toLatin1()); + options.insert(QLatin1String("current_folder"), d->directory.toLatin1().append('\0')); if (!d->selectedFiles.isEmpty()) - options.insert(QLatin1String("current_file"), d->selectedFiles.first().toLatin1()); + options.insert(QLatin1String("current_file"), d->selectedFiles.first().toLatin1().append('\0')); } // Insert filters -- cgit v1.2.3