So, an iteration gives me the following log:
QStandardPaths: wrong permissions on runtime directory /run/user/32011
[StateSaver] No XDG_RUNTIME_DIR path set, cannot create appstate file.
The code prints this out is:
QStringList runtimeDirs = QStandardPaths::standardLocations(QStandardPaths::RuntimeLocation);
QString runtimeDir = runtimeDirs.size() > 0 ? runtimeDirs[0] : qgetenv("XDG_RUNTIME_DIR");
if (runtimeDir.isEmpty()) {
qWarning() << "[StateSaver] No XDG_RUNTIME_DIR path set, cannot create appstate file.";
return;
}
Which means that runtimeDirs string list is empty. If I do change the code to
QStringList runtimeDirs = QStandardPaths::standardLocations(QStandardPaths::RuntimeLocation);
QString runtimeDir = (runtimeDirs.size() > 0 && !runtimeDirs[0].isEmpty()) ? runtimeDirs[0] : qgetenv("XDG_RUNTIME_DIR");
if (runtimeDir.isEmpty()) {
qWarning() << "[StateSaver] No XDG_RUNTIME_DIR path set, cannot create appstate file.";
return;
}
then I get the path correctly, because qgetenv() will be used to fetch the path. So, all in all seems QStandardPaths is just not good for this folder :/
So, an iteration gives me the following log:
QStandardPaths: wrong permissions on runtime directory /run/user/32011
[StateSaver] No XDG_RUNTIME_DIR path set, cannot create appstate file.
The code prints this out is: :standardLocati ons(QStandardPa ths::RuntimeLoc ation); "XDG_RUNTIME_ DIR"); isEmpty( )) {
QStringList runtimeDirs = QStandardPaths:
QString runtimeDir = runtimeDirs.size() > 0 ? runtimeDirs[0] : qgetenv(
if (runtimeDir.
qWarning() << "[StateSaver] No XDG_RUNTIME_DIR path set, cannot create appstate file.";
return;
}
Which means that runtimeDirs string list is empty. If I do change the code to :standardLocati ons(QStandardPa ths::RuntimeLoc ation); 0].isEmpty( )) ? runtimeDirs[0] : qgetenv( "XDG_RUNTIME_ DIR"); isEmpty( )) {
QStringList runtimeDirs = QStandardPaths:
QString runtimeDir = (runtimeDirs.size() > 0 && !runtimeDirs[
if (runtimeDir.
qWarning() << "[StateSaver] No XDG_RUNTIME_DIR path set, cannot create appstate file.";
return;
}
then I get the path correctly, because qgetenv() will be used to fetch the path. So, all in all seems QStandardPaths is just not good for this folder :/