mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 15:06:08 +03:00
Ask before attempting to import legacy accounts
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
4dfab45d5f
commit
fba808103c
1 changed files with 10 additions and 3 deletions
|
@ -175,11 +175,18 @@ bool AccountManager::restoreFromLegacySettings()
|
|||
legacyCfgFileGrandParentFolder + legacyCfgFileRelativePath};
|
||||
|
||||
for (const auto &configFile : legacyLocations) {
|
||||
if (const QFileInfo configFileInfo(configFile);
|
||||
configFileInfo.exists() && configFileInfo.isReadable()) {
|
||||
|
||||
if (const QFileInfo configFileInfo(configFile); configFileInfo.exists() && configFileInfo.isReadable()) {
|
||||
qCInfo(lcAccountManager) << "Migrate: checking old config " << configFile;
|
||||
|
||||
const auto importQuestion = tr("An existing configuration from a legacy desktop client was detected.\n"
|
||||
"Should an account import be attempted?");
|
||||
const auto messageBoxSelection = QMessageBox::question(nullptr, tr("Legacy import"), importQuestion);
|
||||
|
||||
if (messageBoxSelection == QMessageBox::No) {
|
||||
// User said don't import, return immediately
|
||||
return false;
|
||||
}
|
||||
|
||||
auto oCSettings = std::make_unique<QSettings>(configFile, QSettings::IniFormat);
|
||||
if (oCSettings->status() != QSettings::Status::NoError) {
|
||||
qCInfo(lcAccountManager) << "Error reading legacy configuration file" << oCSettings->status();
|
||||
|
|
Loading…
Reference in a new issue