QStandardPaths::AppDataLocation returns only \u0011 under FreeBSD
Solved
General and Desktop
-
According to documentation of
QStandardPaths
itsAppDataLocation
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.