Open Toorero opened 3 years ago
I'd like to take a crack at implementing this when I get the time, so here's a few preemptive questions for the maintainers:
QStandardPaths::AppLocalDataLocation
== ~\AppData\Local\
instead of Roaming
)QStandardPaths
entry for XDG_STATE_HOME
(the spec is quite new) and most environments don't "implement" it yet (neither the variable nor the dir itself exist), would it make more sense to use the AppLocalDataLocation
(~/.local/share/
) on Linux as well?Thanks for your proposition of help Sorry for the long time with no reply
I'd like to take a crack at implementing this when I get the time, so here's a few preemptive questions for the maintainers:
1. Should this also be done for Windows? (logging moved to `QStandardPaths::AppLocalDataLocation` == `~\AppData\Local\` instead of `Roaming`)
I would say yes
2. Since there isn't a `QStandardPaths` entry for `XDG_STATE_HOME` (the spec is quite new) and most environments don't "implement" it yet (neither the variable nor the dir itself exist), would it make more sense to use the `AppLocalDataLocation` (`~/.local/share/`) on Linux as well?
again yes especially because I do not think many software already use ~/.local/state (I only see files from pipiwire on my system)
3. _Changing [defaultLogDir](https://github.com/nextcloud/desktop/blob/ca4b4cde61484570ecd7e1cb63e37880e35a5fbf/src/libsync/configfile.cpp#L954) should be sufficient, right?_
You should also test that creating a debug archive for example still work as intended
Did some research about paths in Nextcloud desktop client. Files, which worth attention:
src/gui/accountmanager.cpp - migration of "very old" configs
src/gui/application.cpp - migration of old configs
src/gui/syncrunfilelog.cpp - writes "nextcloud_sync.log" to QStandardPaths::AppDataLocation
, possibly for #6201
src/libsync/account.cpp - creates cookies0.db file in QStandardPaths::AppConfigLocation
applicable for #5208
src/libsync/configfile.cpp - sets confDir, ConfigFile::configPath()
is used as main path for logs, etc.
In fact, only syncrunfilelog.cpp, account.cpp, configfile.cpp needs changes. This allow to align client with XDG. But what should be done for Mac OS and Windows? Keep current behavior or something else? This solution is enough? https://github.com/nextcloud/desktop/issues/6201#issuecomment-2340450498
Ilya @.***> writes:
In fact, only syncrunfilelog.cpp, account.cpp, configfile.cpp needs changes. This allow to align client with XDG. But what should be done for Mac OS and Windows? Keep current behavior or something else? This solution is enough? https://github.com/nextcloud/desktop/issues/6201#issuecomment-2340450498
I think using QStandardPaths::StateLocation is fine as long as there's a compatibility function for Qt below 6.7.
Expected behaviour
Logs should be saved (as stated by freedesktop) in the
XDG_STATE_HOME
. A log is clearly not a "user-specific configuration" and logs are explicitly featured as an example of data that should be stored inXDG_STATE_HOME
Actual behaviour
Logs are stored in the
XDG_CONFIG_HOME
instead in theNextcloud
folder instead.Steps to reproduce
Just use the client and let it produce logs.
Client configuration
Client version: 3.2.2git
Operating system: Archlinux
OS language: German
Qt version used by client package (Linux only, see also Settings dialog): 5.15.2+kde+r196-1
Client package (From Nextcloud or distro) (Linux only): 3.2.2-1
Installation path of client:
/usr/share/nextcloud