From kde-core-devel Sun Jun 07 22:44:36 2009 From: George Kiagiadakis Date: Sun, 07 Jun 2009 22:44:36 +0000 To: kde-core-devel Subject: Re: Save file dialog: "Overwrite file" behaviour/implementation. Message-Id: X-MARC-Message: https://marc.info/?l=kde-core-devel&m=124441472417551 Moving this discussion to kde-core-devel, where it belongs... 2009/6/8 Darío Andrés : > Hi everyone!. As a possible solution to > https://bugs.kde.org/show_bug.cgi?id=185590 ("overwrite file" function > being implemented on the application instead of using the > KFileDialog::confirmOverwrite option (even when it may not need to do > anything special to it)), I suggest to add an extra optional parameter > to every KFileDialog/KEncodingFileDialog save-related static function. > (IIRC we can modify the API if this do not affect the existent > applications behaviour) > > Can this be done? Do you have any other thought about this? Any drawback? > Do you remember any other application that is not using the default method? > > This proposal will be useful to unify the Overwrite file behaviour > which I recently fixed regarding > https://bugs.kde.org/show_bug.cgi?id=192333 (as Overwrite is a > destructive action, Cancel should be focused by default instead of the > Overwrite button itself) > > Thanks in advance. > Regards > > Dario > KDE BugSquad Team 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?