[SailfishDevel] xdg folder stuff: howto? more info

Reto Zingg reto.zingg at jolla.com
Wed Jan 8 09:54:09 UTC 2014


Hi,

On 08.01.2014 10:55, Wim de Vries wrote:
> Hi,
> I am adding some more info to my question.
> I am using QStandardPaths.
> Harbour is refusing my app, stating that I should use $XDG_CONFIG_HOME
> Still, this var is not set. The only ones are:
> "XDG_SESSION_ID" value: "c5"
> and
> "XDG_RUNTIME_DIR" value: "/run/user/100000"
> I need to add data files during installation, and the user should be
> able to add/remove data files from his PC via USB.
> Thanks.
>

The spec says:

If $XDG_DATA_HOME is either not set or empty, a default equal to 
$HOME/.local/share should be used.

If $XDG_CONFIG_HOME is either not set or empty, a default equal to 
$HOME/.config should be used.

AFAIK does QStandartPath not yet do the right thing, there is a bug.


as the Harbour FAQs says about XDG_*_HOME:
  _Do not_ create the subfolder in the rpm package, create it during 
_run time_ from the application!

I assume you create the folder already in the rpm? Put your files to 
/usr/share/$NAME and copy it form there to $XDG_DATA_HOME (if set resp. 
$HOME/.local/share/$NAME if not set) at launch.

Or it might also be that you use /home/nemo instead of $HOME? That your 
app got rejected.

br
Reto

>
>
> On 01/07/2014 07:29 PM, Wim de Vries wrote:
>> Hi,
>> Can someone please explain how the XDG folders work.
>> These env vars seem not be set when I try to read the values with
>> QProcessEnvironment.
>> So how can I read/write to those folders (C++)?
>> And how to access them from QML?
>> The documention/FAQ only gives a very general spec.
>> I must be missing sth.
>> Thanks.
>>
>> _______________________________________________
>> SailfishOS.org Devel mailing list
>>
>
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list
>



More information about the Devel mailing list