adil192 / super_nonogram

https://supernonogram.adil.hanney.org/
GNU Affero General Public License v3.0
9 stars 1 forks source link

Don't use Documents directory for storing data #1

Closed TiZ-HugLife closed 1 year ago

TiZ-HugLife commented 1 year ago

Migrating this from the issue I previously made in the Flathub repository because it comes from behavior here in the main app.

This app currently creates a folder in the Documents directory for saving custom puzzles. That may be okay to do on Windows, but Linux for one is much more stringent about convention; the Documents directory is not a dumping ground for general data. It is for user documents.

You currently are using getApplicationDocumentsDirectory() to find a place to store files. I am not acclimated to Flutter at all, but I did a cursory search of its documentation. You probably want getApplicationSupportDirectory() instead; this will probably correspond to $XDG_DATA_HOME, which defaults to $HOME/.local/share for non-Flatpak apps and $HOME/.var/app/$APP_ID/data for Flatpak apps.

You can then remove xdg-documents create permissions. I'm surprised that Flathub's maintainers didn't catch this and advise you to change it before approving your submission.

TiZ-HugLife commented 1 year ago

Thank you for addressing this quickly! I'll look forward to the next release incorporating this fix. :)

adil192 commented 1 year ago

Thanks for the issue! I'll keep this in mind in the future