Fix file operations on Android
This patch uses Qt5.13's Native file dialog implementation, with my patches on top to make them work. One of the patch being a hack with url/filename/suffix (etc..) handling. The details about hacks is in this gist
PS: Currently, we don't need any permission (i.e WRITE_EXTERNAL_STORAGE
which we ask). But I found some QStandardPaths
to rely on them, so I haven't modified this bit to be safe.
(I thought the vector files not being written would be related to this, but this doesn't seem to fix it)
Test Plan
- Opening files should work (test with multiple different extensions/mime-types)
- Saving should work
- Saving to remote storages should work now as well
- Saving a new file should work (test with diverse extensions and duplicate names)
- Importing bundles should work (but there's a small problem with checksum, which I haven't looked into properly)
- Disabling Native file dialog should work (not recommended, because it opens in seemingly random directory)
Formalities Checklist
-
I confirmed this builds. -
I confirmed Krita ran and the relevant functions work. -
I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!) -
I made sure my commits build individually and have good descriptions as per KDE guidelines. -
I made sure my code conforms to the standards set in the HACKING file. -
I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.