-
Notifications
You must be signed in to change notification settings - Fork 668
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 config data migration from 2.8 to 2.9 #8860
Conversation
src/gui/application.cpp
Outdated
|
||
// note: this change is temporary to allow using QDesktopServices etc. to determine the paths | ||
// the application name was changed to | ||
const auto oldApplicationName = app->applicationName(); |
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.
Maybe a inner scope with a QScopeGuard to reset the app name
src/gui/application.cpp
Outdated
qCWarning(lcApplication) << "Failed to move the old config directory to its new location (" << oldDir << "to" << confDir << ")"; | ||
|
||
// Try to move the files one by one | ||
if (QFileInfo(confDir).isDir() || QDir().mkdir(confDir)) { |
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.
While touching this, maybe https://doc.qt.io/qt-5/qdir.html#entryInfoList-1 instead of manually constructing the path.
QDir().mkdir(confDir)
will try to create confDir
in the current working dir 😲 I'd say that never worked.
QApplication::applicationName() is not necessarily stable, as its value has changed a lot (e.g., from 2.8 to 2.9). Therefore, using it should be avoided. The theme allows using both short and GUI name explicitly.
This commit adds a migration path for migrations from 2.8 to 2.9. It uses the exact same mechanism implemented for migrations from 2.4 and before, but extends it into a loop that iterates over all possible old config locations.
Kudos, SonarCloud Quality Gate passed! |
Closes #8824.