Skip to content
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

Merged
merged 3 commits into from
Aug 6, 2021
Merged

Fix config data migration from 2.8 to 2.9 #8860

merged 3 commits into from
Aug 6, 2021

Conversation

fmoc
Copy link
Contributor

@fmoc fmoc commented Aug 2, 2021

Closes #8824.

@fmoc fmoc requested a review from TheOneRing August 2, 2021 15:52

// 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();
Copy link
Member

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

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)) {
Copy link
Member

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.

@TheOneRing TheOneRing changed the base branch from master to 2.9 August 5, 2021 15:23
Fabian Müller added 2 commits August 6, 2021 17:04
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.
@fmoc fmoc merged commit 4b93bce into 2.9 Aug 6, 2021
@delete-merged-branch delete-merged-branch bot deleted the work/issue-8824 branch August 6, 2021 15:43
@sonarcloud
Copy link

sonarcloud bot commented Aug 6, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression use of legacy settings location
2 participants