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

[stable-3.11] Fix: remove failure to import legacy account notification. #6383

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/gui/accountmanager.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/gui/accountmanager.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/gui/accountmanager.cpp

File src/gui/accountmanager.cpp does not conform to Custom style guidelines. (lines 270, 271)
* Copyright (C) by Olivier Goffart <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -154,6 +154,8 @@
// try to open the correctly themed settings
auto settings = ConfigFile::settingsWithGroup(Theme::instance()->appName());

auto displayMessageBoxWarning = false;

// if the settings file could not be opened, the childKeys list is empty
// then try to load settings from a very old place
if (settings->childKeys().isEmpty()) {
Expand Down Expand Up @@ -189,6 +191,7 @@
const auto accountsListSize = oCSettings->childGroups().size();
oCSettings->endGroup();
if (const QFileInfo configFileInfo(configFile); configFileInfo.exists() && configFileInfo.isReadable()) {
displayMessageBoxWarning = true;
qCInfo(lcAccountManager) << "Migrate: checking old config " << configFile;
if (!forceLegacyImport() && accountsListSize > 0) {
const auto importQuestion = accountsListSize > 1
Expand Down Expand Up @@ -256,16 +259,19 @@
for (const auto &accountId : childGroups) {
settings->beginGroup(accountId);
if (const auto acc = loadAccountHelper(*settings)) {
addAccount(acc);
addAccount(acc);
}
settings->endGroup();
}
return true;
}

QMessageBox::information(nullptr,
tr("Legacy import"),
tr("Could not import accounts from legacy client configuration."));
if (displayMessageBoxWarning) {
QMessageBox::information(nullptr,
tr("Legacy import"),
tr("Could not import accounts from legacy client configuration."));
}

return false;
}

Expand Down
Loading