This is a bug in Qt (see bug report). However, it happens only if you didn't set your app's name and organization name. You should set them using QApplication::setApplicationName
and QApplication::setOrganizationName
.
The chop
solution you've accepted earlier is bad for two reasons. The first, if this bug is fixed, your code could be broken. Who knows how many slashed will be here in the next version (maybe 0). I'd suggest to use the following to remove double slash:
QString s = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
s = QDir(s).absolutePath();
But it's more important that the /home/user/.local/share/data/
location is still invalid. You need to set application and organization names if you want to get proper location. Simple removing trailing slash doesn't fix anything, it's just a dirty hack.