Commit ccea9858 authored by Jan Grulich's avatar Jan Grulich
Browse files

FileChooser: make use of current_name property in Save dialog

It's not used in Qt portal implementation, but gtk has API for that and sets it in Save dialog
and we should try to call selectFile() with it to get pre-selected file for the dialog

BUG: 402077
parent 428d3c99
......@@ -249,11 +249,6 @@ uint FileChooserPortal::SaveFile(const QDBusObjectPath &handle,
fileDialog->setModal(modalDialog);
fileDialog->setAcceptMode(QFileDialog::AcceptSave);
// TODO: Looks Qt doesn't have API for this
// if (!currentName.isEmpty()) {
// fileDialog->selectFile(currentName);
// }
if (!currentFolder.isEmpty()) {
fileDialog->setDirectoryUrl(QUrl(currentFolder));
}
......@@ -262,6 +257,10 @@ uint FileChooserPortal::SaveFile(const QDBusObjectPath &handle,
fileDialog->selectFile(currentFile);
}
if (!currentName.isEmpty()) {
fileDialog->selectFile(currentName);
}
if (!acceptLabel.isEmpty()) {
fileDialog->setLabelText(QFileDialog::Accept, acceptLabel);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment