Review Request: Provide static KFileDialog::getSave* functions with "confirm overwrite" option

David Faure faure at kde.org
Sat Jul 4 17:47:16 BST 2009



> On 2009-07-04 06:53:20, David Jarvie wrote:
> > The existing functions should work exactly as they do now. The different default value for confirm-overwrite in the new functions' options parameter, which depends on isNative(), is there because in Windows, the current default is to confirm overwrite while on Linux it is to not confirm overwrite. Again, this is simply to preserve the way the current functions work.
> > 
> > I don't understand your comments about startDir.

I'm referring to the fact the use of QFileDialog is controlled by the following if statement:
   if (KFileDialogPrivate::isNative() && (!startDir.isValid() || startDir.isLocalFile())) {

So your test with KFileDialogPrivate::isNative() is not enough to know if QFileDialog is going to be used or not.

But anyway, the default to "confirm overwrite" on Windows makes no sense to me. The applications that do not call setConfirmOverwrite, implement overwrite-confirmation themselves, so with a reverse default on Windows they will end up asking for confirmation twice... this doesn't make sense. I don't see why the platform should make any difference for that setting, it's not a platform issue, but an application-code issue (whether it checks for existing file itself or not). Isn't this just a side effect of the use of QFileDialog, rather than a voluntary behavior in the current code? It sounds like your added option would be the right opportunity to fix exactly that - rather than preserve buggy behavior.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/822/#review1461
-----------------------------------------------------------


On 2009-06-10 14:44:59, David Jarvie wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/822/
> -----------------------------------------------------------
> 
> (Updated 2009-06-10 14:44:59)
> 
> 
> Review request for kdelibs.
> 
> 
> Summary
> -------
> 
> Add new overloads of the static KFileDialog::getSave* functions to allow "confirm overwrite" and other options to be specified. Ideally the new variants would replace the existing functions, but that is not possible for binary compatibility reasons during KDE4.
> 
> The new functions will allow the static KFileDialog functions to be used in cases where "confirm overwrite" is needed, without the developer having to construct a KFileDialog and set it up manually (thereby losing the convenience of the static functions which among other things automatically call native file dialogs when appropriate). This will improve consistency between applications as well as reducing developer work.
> 
> KEncodingFileDialog would benefit from a similar change, but it would need access to KFileDialogPrivate::isNative() to do this properly - this could presumably be provided via a new protected method in KFileDialog (being non-virtual, presumably it wouldn't be BIC?).
> 
> This change is proposed for KDE 4.4.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdelibs/kio/kfile/kfiledialog.h 951469 
>   /trunk/KDE/kdelibs/kio/kfile/kfiledialog.cpp 951469 
> 
> Diff: http://reviewboard.kde.org/r/822/diff
> 
> 
> Testing
> -------
> 
> getSaveFileName() and getSaveUrl() tested successfully in KAlarm.
> 
> 
> Thanks,
> 
> David
> 
>





More information about the kde-core-devel mailing list