I have a question that's not so much about Compose...
# compose-desktop
t
I have a question that's not so much about Compose as about desktop applications... how do you know where to store files for the user? Is there any standard for that, or does everyone just have to reinvent that particular wheel for their own application?
a
since you have the JVM, you can query for the user's home directory as such:
System.getProperty("user.home")
m
It depends on what type of files they are (preferences, user generated data, volatile caches etc).
t
I was mostly thinking of user-generated data—journal entries, in this case—but really any of it. (Except for window settings, which I think are managed by the desktop environment or the GUI toolkit.)
That library looks great!
m
In that case if you don't have an explicit save process, just create a directory in the user's $HOME or %USERHOME% directory and let them change the path if they want to. Don't stick user generated data in hidden locations as otherwise it might not get backed up, and some users will want to move those files to a cloud drive.
t
What I'm struggling with is that I don't want my user's first experience of the application to be "here, make an annoying and arbitrary decision about file storage". But obviously I do want to empower them to make usable backups, etc.
Currently I ask them to pick a location, but I prefill the dialog box with something that looks plausible. Maybe I could suggest multiple?
~/thing
,
~/documents/thing
,
~/.local/[...]/thing
, pick-your-own.
(and then I have to store a pointer to the chosen location in
.local
or whatever)
I feel like most applications don't ask this question at all.