Bug 186230 - extend kfiledialog: syntax to make it more useful for saving
Summary: extend kfiledialog: syntax to make it more useful for saving
Status: RESOLVED FIXED
Alias: None
Product: kfile
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-05 16:29 UTC by Jonathan Marten
Modified: 2009-04-09 15:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Patch to KFileWidget (10.09 KB, patch)
2009-03-05 16:32 UTC, Jonathan Marten
Details
Updated patch (30.39 KB, patch)
2009-03-10 14:21 UTC, Jonathan Marten
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Marten 2009-03-05 16:29:06 UTC
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
Comment 1 Jonathan Marten 2009-03-05 16:32:14 UTC
Created attachment 31800 [details]
Patch to KFileWidget

Proposed patch.  Tested against current trunk with both modified and unmodified applications.
Comment 2 Jonathan Marten 2009-03-10 14:21:26 UTC
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.
Comment 3 Albert Astals Cid 2009-03-29 23:59:29 UTC
Jonathan you don't seem to have commited the code yet, right? dfaure gave you a green light
Comment 4 Jonathan Marten 2009-04-08 19:04:09 UTC
@aacid: Sorry, have been away on holiday.  Will commit as soon as my copy of trunk is up-to-date...
Comment 5 Jonathan Marten 2009-04-09 15:05:01 UTC
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