| Summary: | Exporting on Android can end up with a useless filename | ||
|---|---|---|---|
| Product: | [Applications] krita | Reporter: | Tiar <tamtamy.tymona> |
| Component: | File formats | Assignee: | Krita Bugs <krita-bugs-null> |
| Status: | RESOLVED UPSTREAM | ||
| Severity: | normal | CC: | dra.w.p.il.e+bugskde, shzam |
| Priority: | NOR | ||
| Version First Reported In: | 5.2.9 | ||
| Target Milestone: | --- | ||
| Platform: | Android | ||
| OS: | Android 14.x | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | screenshot-overwrite-dialog | ||
|
Description
Tiar
2025-06-23 12:37:28 UTC
Created attachment 182883 [details]
screenshot-overwrite-dialog
Oddly if you Create a new file and then Save it it *can* overwrite it. So maybe we are not setting the flags correctly...
I looked into this. The reason it doesn't work is because Qt uses ACTION_CREATE_DOCUMENT to save files. To quote https://developer.android.com/training/data-storage/shared/documents-files#create-file > Note: ACTION_CREATE_DOCUMENT cannot overwrite an existing file. If your app tries to save a file with the same name, the system appends a number in parentheses at the end of the file name. The alternative would be to use ACTION_OPEN_DOCUMENT_TREE, but that doesn't support a bunch of other stuff. For example, the the user can't save to a bunch of directories, such as the downloads directory, instead being told that they can't choose that directory to "protect their privacy". They can also no longer save to other storage providers, such as Google Drive, since they aren't directories. Which is probably more important than the ability to overwrite files. So I don't think there's a sensible fix for this on Krita's side, it's just yet another case where the Android file system is bad and we need to implement an entirely different concept of saving images on Android instead, cf. https://invent.kde.org/graphics/krita/-/issues/20 |