Commit 975a49b3 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

Set supported schemes to "file" for getsavefilename

This was done in getopenfilename but not getsavefilename.
Since it calls selectedFiles when the dialog is accepted, any non-file URL will result in an empty return value.

Differential Revision: https://phabricator.kde.org/D11108
parent 45573c44
......@@ -775,13 +775,17 @@ int main(int argc, char *argv[])
dlg.setDirectoryUrl(initialDirectory(startUrl));
dlg.selectFile(initialSelection(startUrl));
setFileDialogFilter(dlg, filter);
const bool saveUrls = parser.isSet("getsaveurl");
if (!saveUrls) {
dlg.setSupportedSchemes({"file"});
}
Utils::handleXGeometry(&dlg);
dlg.setWindowTitle(title.isEmpty() ? i18nc("@title:window", "Save As") : title);
if (!dlg.exec()) {
return 1; // canceled
}
if ( parser.isSet("getsaveurl") ) {
if (saveUrls) {
const QList<QUrl> result = dlg.selectedUrls();
if (!result.isEmpty()) {
cout << result.at(0).toString().toLocal8Bit().data() << endl;
......
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