Thanks for the elaborate answer.
Now that I understand the harbour remarks, I can rephrase my question
about user/app data files in a new topic: "where to install user
(controlled) data files for my app".
Thanks again.
r
wim
On 01/09/2014 12:13 AM, Alejandro Exojo wrote:
El Wednesday 08 January 2014, wsvries escribió:
Thanks Reto, Jonni,
I am still puzzled (please see harbour comments below).
I assume that the XDG naming is only to be used in the program code
itself (not in .pro or .yaml).
So, I would need to replace (in .pro)
data.files = checklistsdata/*Now things
data.path = /home/nemo/Documents/checklistsdata
with
data.files = checklistsdata/*
data.path = /usr/share/$NAME/checklistsdata
Seems correct. Your app is now where system things are, not where user things
are (hint: /home is where the "home" of users is, so your application, and no
application at all, don't belong there).
and in first execution copy /usr/share/$NAME/checklistsdata to
$XDG_CONFIG_HOME/$NAME/checklistsdata or
$HOME/.config/$NAME/checklistsdata
(though I would think that $XDG_DATA_HOME would be better)
That depends. Why your application needs to copy or move files? What's
"checklistdata"?
I suggest you give a look at the FHS:
https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
The problem is that (certainly in my next app with loads of map data)
data files end up in /usr/share/$NAME.
There is no way for the app (no root permission) to clean up the
/usr/share/$NAME directory.
Certainly not. Things in /usr mean the system, and the system doesn't change,
unless is being updated or something new is being installed, but is not the
normal situation.
The data that _is_ your application belongs to /usr. That includes graphics,
or other assets.
The data that belongs to the user, and is created or modified by the
application belongs by the path of the user that runs the application, which
is $HOME (/home/nemo in our case).
If the data are documents visible to the user (like a music file or a picture
or a document), belongs in some directory of the ones that are already there
on the phone (/home/nemo/Videos for example).
If is data that is internal to the application, like some thumbnails of
pictures downloaded from the web, and saved only as a cache, belong in some
hidden directory, like /home/nemo/.local/share/NAME. Although the
".local/share" part here is hardcoded, and one user might want to change this
using the $XDG_* variables.
_______________________________________________
SailfishOS.org Devel mailing list