QStandardPaths::AppDataLocation returns only \u0011 under FreeBSD



  • According to documentation of QStandardPaths its AppDataLocation should resolve to either of

    "~/.local/share/<APPNAME>",
    "/usr/local/share/<APPNAME>",
    "/usr/share/<APPNAME>"

    under Linux. I was expecting that under FreeBSD it would resolve to something similar.
    But all I am getting back is a Unicode symbol \u0011

    QString defpath = "";
    ...
    defpath.append(QStandardPaths::AppDataLocation); // this is where defpath == \u0011
    

    Am I misusing the class/member or is its implementation broken under FreeBSD?



  • QStandardPaths::AppDataLocation is an enumerator value, so:

    defpath.append(QStandardPaths::AppDataLocation);
    

    is actually saying: append an integer to the string.

    I think you want to do something like this instead:

    defpath.append(QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).first());
    

    or

    defpath.append(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
    

    Cheers.



  • Who in their twisted mind?.. Oh, same old.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.