fix(application): add folders after accounts are created during migration.

Signed-off-by: Camila Ayres <hello@camilasan.com>
This commit is contained in:
Camila Ayres 2025-06-30 12:33:20 +02:00
parent abe58a6640
commit 4b7ef6eab7
No known key found for this signature in database
GPG Key ID: 7A4A6121E88E2AD4
3 changed files with 6 additions and 2 deletions

View File

@ -480,11 +480,11 @@ Application::~Application()
void Application::setupAccountsAndFolders()
{
_folderManager.reset(new FolderMan);
FolderMan::instance()->setSyncEnabled(true);
const auto accountsRestoreResult = restoreLegacyAccount();
const auto foldersListSize = FolderMan::instance()->setupFolders();
FolderMan::instance()->setSyncEnabled(true);
const auto prettyNamesList = [](const QList<AccountStatePtr> &accounts) {
QStringList list;

View File

@ -604,6 +604,9 @@ void FolderMan::setupLegacyFolder(const QString &fileNamePath, AccountState *acc
settings.beginGroup(settingsFoldersWithPlaceholdersC);
migrateFoldersGroup(settingsFoldersWithPlaceholdersC);
#ifdef Q_OS_WIN
_navigationPaneHelper.scheduleUpdateCloudStorageRegistry();
#endif
settings.endGroup();
settings.beginGroup(settingsFoldersC);

View File

@ -66,11 +66,12 @@ void NavigationPaneHelper::updateCloudStorageRegistry()
Utility::registryWalkSubKeys(HKEY_CURRENT_USER, nameSpaceKey,
[&entriesToRemove](HKEY key, const QString &subKey) {
const auto appName = Utility::registryGetKeyValue(key, subKey, QStringLiteral("ApplicationName"));
qCDebug(lcNavPane) << "Searching for user with subKey:" << subKey;
qCDebug(lcNavPane) << "Searching for user with subKey:" << subKey << "for appName:" << appName.toString();
if (appName.toString() == QLatin1String(APPLICATION_NAME) || appName.toString() == unbrandedApplicationName) {
QUuid clsid{ subKey };
Q_ASSERT(!clsid.isNull());
entriesToRemove.append(clsid);
qCDebug(lcNavPane) << "Going to remove:" << subKey;
}
});
}