diff --git a/src/kdialog.cpp b/src/kdialog.cpp --- a/src/kdialog.cpp +++ b/src/kdialog.cpp @@ -254,6 +254,18 @@ return url.adjusted(QUrl::RemoveFilename); } +static QStringList schemesthatReturnLocalFiles() + { + return { + QStringLiteral("desktop") + , QStringLiteral("file") + , QStringLiteral("recentlyused") + , QStringLiteral("trash") + , QStringLiteral("tags") + // TODO: whatever provides removable devices + }; + } + int main(int argc, char *argv[]) { // Bug 373677: Qt removes various arguments it treats internally (such as title and icon) from args @@ -797,7 +809,7 @@ } const bool openUrls = parser.isSet(QStringLiteral("getopenurl")); if (!openUrls) { - dlg.setSupportedSchemes({QStringLiteral("file")}); + dlg.setSupportedSchemes(schemesthatReturnLocalFiles()); } setFileDialogFilter(dlg, filter); Utils::handleXGeometry(&dlg); @@ -850,7 +862,7 @@ setFileDialogFilter(dlg, filter); const bool saveUrls = parser.isSet(QStringLiteral("getsaveurl")); if (!saveUrls) { - dlg.setSupportedSchemes({QStringLiteral("file")}); + dlg.setSupportedSchemes(schemesthatReturnLocalFiles()); } Utils::handleXGeometry(&dlg); dlg.setWindowTitle(title.isEmpty() ? i18nc("@title:window", "Save As") : title);