Version: (using Devel) OS: Linux Installed from: Compiled sources The ability to use the "kfiledialog:///keyword" syntax in KFileDialog::getSaveUrl() and the other static functions is not particularly useful for saving. Typically in this case the application will want to specify both a "start directory" and a "suggested file name", but it is not possible to specify both a "recent keyword" (using the "kfiledialog:" syntax) and a file name. Applications wishing to do this need to either handle the location history themselves, or use the KFileDialog constructor, in both cases introducing unnecessary complexity and duplication. Suggest extending the syntax to be able to specify both the keyword and filename, with an URL of the form "kfiledialog:///keyword/filename". This should be compatible with any existing uses, but would allow applications to take advantage if required. As a measure of their current usefulness, the static getSave* methods are used nowhere in kdebase, and a total of 10 times in kdeedu, kdepim, kdeutils and extragear together. See discussion thread at http://lists.kde.org/?l=kde-devel&m=123565715426002&w=2
Created attachment 31800 [details] Patch to KFileWidget Proposed patch. Tested against current trunk with both modified and unmodified applications.
Created attachment 31989 [details] Updated patch Patch updated in accordance with comments at http://lists.kde.org/?l=kde-core-devel&m=123655642309183&w=2 API documentation updated for KFileDialog and KFileWidget. Test cases added in kio/kfile/tests.
Jonathan you don't seem to have commited the code yet, right? dfaure gave you a green light
@aacid: Sorry, have been away on holiday. Will commit as soon as my copy of trunk is up-to-date...
SVN commit 951469 by marten: Extend the file selector's "kfiledialog:" URL syntax to allow both a starting directory keyword and a suggested file name to be specified, in the form "kfiledialog:///keyword/filename" or "kfiledialog:///keyword/filename?global". Useful for saving, as otherwise there was no way to specify both using the static get Save*() functions. Updated API documentation for KFileDialog and KFileWidget to reflect this. Patch reviewed by aacid and David Faure. BUG:186230 M +70 -18 kfile/kfilewidget.cpp M +54 -16 kfile/kfilewidget.h M +1 -1 kio/kfile/kfiledialog.cpp M +62 -115 kio/kfile/kfiledialog.h M +11 -1 kio/kfile/tests/kfiledialogtest.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=951469