Save file dialog: "Overwrite file" behaviour/implementation.

Michael Leupold lemma at confuego.org
Mon Jun 8 01:37:41 BST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

George Kiagiadakis wrote:
> Adding a new argument to the existing static KFIleDialog::getSave*
> functions is binary incompatible afaik, but instead of doing this,
> maybe we should change the default behavior of those functions to ask
> before overwriting files.
> 
> I'll explain a bit better the problem for people that have not
> understood. Currently those functions return a file name without
> checking if it exists or not and without asking the user if he wants
> to overwrite it, which leads application developers to implement a
> "confirm overwrite" dialog, which may differ in behavior in each
> application and possibly cause usability issues like the one in bug
> 185590. However, KFileDialog does have support for confirming
> overwrite, but to use this feature you need to abandon the very
> convenient static methods and construct a KFileDialog object manually
> and call dialog->setConfirmOverwrite(true);
> 
> My suggestion here is to make this the default for the static methods,
> which is something that probably most applications will want to have.
> Of course this creates the problem that every application that uses a
> custom confirm overwrite dialog will have to remove it, but it will be
> difficult to track down all apps that do that. So, another option
> would be to add new overloaded static methods that have the option to
> ask for overwrite and suggest application developers to to use these
> methods instead.
> 
> What do you think?

I'd go with the latter and suggest using the new method. I fear changing the 
default behaviour is a no-no as it will lead to unexpected behaviour (eg. 
asking the user twice because the application-defined overwrite confirmation 
is still there and the static method still only return the name of an 
existing file). Apart from that the idea sounds necessary and sane.

Regards,
Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFKLF1XlfpzINIAlVsRAs5DAJ4vYUm2V258PcbciygKmCUNEQvoTwCePAir
jKAOFMgaB8+qDwP5axraCFI=
=epdi
-----END PGP SIGNATURE-----






More information about the kde-core-devel mailing list