SUMMARY Krita doesn't ask to replace file while exporting some formats, unless the file extension is manually typed. STEPS TO REPRODUCE 1. Export file "test.png" 2. Export file "test.png" in the same folder. Don't type out the ".png" extension, let Krita add it automatically OBSERVED RESULT When typing the file name, the existing file with the same name does not get highlighted in the file browser. The “test.png already exists. Do you want to replace it?” dialog doesn't show up, instead it skips to the export settings. With formats that don't have export settings (like .ppm), it replaces the file immediately after clicking export. EXPECTED RESULT Krita should always ask before replacing an existing file. SOFTWARE/OS VERSIONS Linux Mint 20.1 Cinnamon tested in Krita 4.4.1, Krita 4.4.5 ADDITIONAL INFORMATION Happens with: .png, .gif, .ppm, .tga Does NOT happen with: .jpg, .exr - when exporting as .jpg or .exr, typing the name of an existing file will highlight it, and after clicking Export the dialog shows up. It also does not happen if the full filename is written when exporting ("test.png" instead of just "test").
I can replicate and confirm this for the July 21 5.0.0-prealpha (git 63be085) appimage on Debian 10. I see the difference in highlighting in the file browser between .png and .jpg and lack of confirmation question for .png
That should be something linux-specific (or native dialogs specific). I cannot reproduce that on Windows.
The bug is reproducible on Linux with native dialogs disabled (I cannot enable native dialogs on Plasma)
Update: I can only reproduce this problem when running Krita from inside the docker environment. AppImage packages seem to work fine...
(In reply to Dmitry Kazakov from comment #4) > Update: I can only reproduce this problem when running Krita from inside the > docker environment. AppImage packages seem to work fine... Hi, I forgot to mention it but this happened to me while using the AppImage version
Created attachment 147604 [details] Screenshot I am unable to reproduce this with Krita 4.2.9, see the screenshot. Could it be fixed?
(In reply to andviane from comment #6) > Created attachment 147604 [details] > Screenshot > > I am unable to reproduce this with Krita 4.2.9, see the screenshot. Could it > be fixed? Sorry, understood. The fine name must be typed in by hand and with no extension. It works fine if the file name has been obtained by clicking on the exiting file if the file selection dialog.
This is because both Export and Save As dialogs rely on the native QFileDialog ability for checking and confirming the file overwrite. If we alter the file name later, as by adding the extension for the typed-in name without extension, this does not longer works as expected.
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1379
Git commit 9d1dd6ed529d23c3ec4806ce3b0e4428155d7830 by Alvin Wong, on behalf of Bourumir Wyngs. Committed on 09/05/2022 at 15:13. Pushed by alvinwong into branch 'master'. Set default file suffix in save dialog When using Qt's non-native QFileDialog, this is needed for the save dialog to correctly append the default file extension, so that the dialog can correctly prompt the user before overwriting an existing file. Related: bug 412651 M +46 -13 libs/widgetutils/KoFileDialog.cpp M +6 -3 libs/widgetutils/KoFileDialog.h https://invent.kde.org/graphics/krita/commit/9d1dd6ed529d23c3ec4806ce3b0e4428155d7830
Git commit 45b8fd5f867e7ea9fedc488cd2e034a616ea36fc by Alvin Wong. Committed on 09/05/2022 at 15:13. Pushed by alvinwong into branch 'master'. ext_qt: Remove patches adding default file suffix They didn't work quite well and relied on specific options being set in caller code, so we are replacing it and handle the default file suffix from Krita directly. Related: bug 412651 D +0 -156 3rdparty/ext_qt/0081-Fix-no-warning-for-overwriting-files-in-non-native-d.patch D +0 -186 3rdparty/ext_qt/0082-Make-jp-e-g-default-extensions-context-aware.patch M +0 -6 3rdparty/ext_qt/CMakeLists.txt https://invent.kde.org/graphics/krita/commit/45b8fd5f867e7ea9fedc488cd2e034a616ea36fc
Git commit 4a53db5eec2cba94af8824aa7c40709db38770bc by Alvin Wong. Committed on 09/05/2022 at 15:13. Pushed by alvinwong into branch 'master'. Stop file dialog from silently appending file extension If the file dialog does not return a file name with a valid file extension, we ask the user to select a file name again. We must not just append the file extension silently because: * it bypasses the file overwrite prompt provided byu the file selector. * doing so will break sandboxed macOS and Android because access to user files is restricted and must be done through the native file selector. M +55 -23 libs/widgetutils/KoFileDialog.cpp https://invent.kde.org/graphics/krita/commit/4a53db5eec2cba94af8824aa7c40709db38770bc