Commit 7be87b22 authored by Jan Grulich's avatar Jan Grulich
Browse files

FileDialog: fix pre-selecting current directory and file

parent 8ced7ed6
......@@ -217,11 +217,11 @@ uint FileChooser::SaveFile(const QDBusObjectPath &handle,
}
if (options.contains(QLatin1String("current_folder"))) {
currentFolder = options.value(QLatin1String("current_folder")).toString();
currentFolder = options.value(QLatin1String("current_folder")).toByteArray();
}
if (options.contains(QLatin1String("current_file"))) {
currentFile = options.value(QLatin1String("current_file")).toString();
currentFile = options.value(QLatin1String("current_file")).toByteArray();
}
if (options.contains(QLatin1String("filters"))) {
......@@ -247,16 +247,17 @@ uint FileChooser::SaveFile(const QDBusObjectPath &handle,
fileDialog->setModal(modalDialog);
fileDialog->setAcceptMode(QFileDialog::AcceptSave);
if (!currentName.isEmpty()) {
fileDialog->selectFile(currentName);
}
// TODO: Looks Qt doesn't have API for this
// if (!currentName.isEmpty()) {
// fileDialog->selectFile(currentName);
// }
if (!currentFolder.isEmpty()) {
fileDialog->setDirectory(currentFolder);
fileDialog->setDirectoryUrl(QUrl(currentFolder));
}
if (!currentFile.isEmpty()) {
fileDialog->selectFile(currentName);
fileDialog->selectFile(currentFile);
}
if (!acceptLabel.isEmpty()) {
......
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