FileChooser portal: Store directory as QUrl instead of QString
Otherwise we lose the scheme when reading it back as QUrl Pick-to: 6.7 6.5 Change-Id: Ice6e083611c93641ef33f00fa48f1b32dc25f718 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 46ffca13fb0705c54ad05bc2c1a37f7d5fb5132d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
79370e0b4c
commit
f57d5c492d
@ -80,7 +80,7 @@ public:
|
||||
|
||||
QEventLoop loop;
|
||||
QString acceptLabel;
|
||||
QString directory;
|
||||
QUrl directory;
|
||||
QString title;
|
||||
QStringList nameFilters;
|
||||
QStringList mimeTypesFilters;
|
||||
@ -170,7 +170,7 @@ void QXdgDesktopPortalFileDialog::openPortal(Qt::WindowFlags windowFlags, Qt::Wi
|
||||
options.insert("directory"_L1, d->directoryMode);
|
||||
|
||||
if (!d->directory.isEmpty())
|
||||
options.insert("current_folder"_L1, QFile::encodeName(d->directory).append('\0'));
|
||||
options.insert("current_folder"_L1, QFile::encodeName(d->directory.toLocalFile()).append('\0'));
|
||||
|
||||
if (d->saveFile && !d->selectedFiles.isEmpty()) {
|
||||
// current_file for the file to be pre-selected, current_name for the file name to be
|
||||
@ -318,7 +318,7 @@ void QXdgDesktopPortalFileDialog::setDirectory(const QUrl &directory)
|
||||
d->nativeFileDialog->setDirectory(directory);
|
||||
}
|
||||
|
||||
d->directory = directory.path();
|
||||
d->directory = directory;
|
||||
}
|
||||
|
||||
QUrl QXdgDesktopPortalFileDialog::directory() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user