[SailfishDevel] Hardcoded Path

Antonio Mancini ziobilly94 at gmail.com
Thu Mar 12 13:33:04 UTC 2015


Hi all,
I have some functions for writing/reading files written in c++
I want to use the  XDG Base Directory Specification but i don't know how to
use it.

For example at the moment i have the directory set like this:

    QDir dir("/home/nemo/.local/share/harbour-sailtris");
    if (!dir.exists())
        dir.mkpath(".");
    QDir::setCurrent("/home/nemo/.local/share/harbour-sailtris");

if i use *$XDG_DATA_HOME *instead of "/home/nemo/.local/share/"
it creates a directory *$XDG_DATA_HOME *in /home/nemo/ and the path is not
absolute, so each time the function is called it enters the previous
directory

Someone can explain to me how this works? :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20150312/2bf9ed8f/attachment.html>


More information about the Devel mailing list