-
Notifications
You must be signed in to change notification settings - Fork 815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix consistent log directory and config dir migration for linux #7665
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1113,7 +1113,10 @@ void ConfigFile::setAutomaticLogDir(bool enabled) | |
|
||
QString ConfigFile::logDir() const | ||
{ | ||
const auto defaultLogDir = QString(configPath() + QStringLiteral("/logs")); | ||
const auto defaultLogDir = QString( | ||
QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) | ||
+ QStringLiteral("/logs") | ||
); | ||
Comment on lines
+1116
to
+1119
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that would create some behavior changes ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, because I find it better to place the log files into the data location ( Currently the On Windows the log and config directories are the same because of the way the config path in src/libsync/configfile.cpp#L366 is generated, but on all other platforms it makes more sense to keep them separated. |
||
QSettings settings(configFile(), QSettings::IniFormat); | ||
return settings.value(QLatin1String(logDirC), defaultLogDir).toString(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused by this change
why do we need to special case windows OS ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the way how the configPath is created in src/libsync/configfile.cpp#L366
For Windows the whole config directory is moved to the data location. On all other platforms only the configuration is moved to the config location (
$XDG_CONFIG_DIR
) and the log files remain in the data location ($XDG_DATA_DIR
).On all other platforms the sync run logs are moved from this location at startup and then the directory is again used to write the sync run logs into. On the next start of the application the cycle begins again.