Properly convert filename to bytearray when sending over portal
We should be using QFile::encodeName() to properly convert filenames from string to bytearray. This takes user's locale into account. Change-Id: I090f73f21feb73af166e88baa0e7f4a595cdb25b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
06b29a62de
commit
1d3a162bfe
|
|
@ -48,6 +48,7 @@
|
|||
#include <QDBusPendingCallWatcher>
|
||||
#include <QDBusPendingReply>
|
||||
|
||||
#include <QFile>
|
||||
#include <QMetaType>
|
||||
#include <QMimeType>
|
||||
#include <QMimeDatabase>
|
||||
|
|
@ -181,10 +182,10 @@ void QXdgDesktopPortalFileDialog::openPortal()
|
|||
|
||||
if (d->saveFile) {
|
||||
if (!d->directory.isEmpty())
|
||||
options.insert(QLatin1String("current_folder"), d->directory.toLatin1().append('\0'));
|
||||
options.insert(QLatin1String("current_folder"), QFile::encodeName(d->directory).append('\0'));
|
||||
|
||||
if (!d->selectedFiles.isEmpty())
|
||||
options.insert(QLatin1String("current_file"), d->selectedFiles.first().toLatin1().append('\0'));
|
||||
options.insert(QLatin1String("current_file"), QFile::encodeName(d->selectedFiles.first()).append('\0'));
|
||||
}
|
||||
|
||||
// Insert filters
|
||||
|
|
|
|||
Loading…
Reference in New Issue