Ensure keychain chunk jobs in account manager run as intended

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-07-08 00:05:45 +08:00
parent e3b002a52d
commit 5db01d4849
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -358,10 +358,10 @@ void AccountManager::saveAccountHelper(Account *acc, QSettings &settings, bool s
const auto proxyPassword = acc->proxyPassword(); const auto proxyPassword = acc->proxyPassword();
if (proxyPassword.isEmpty()) { if (proxyPassword.isEmpty()) {
const auto job = new KeychainChunk::DeleteJob(proxyPasswordKey); const auto job = new KeychainChunk::DeleteJob(proxyPasswordKey);
job->exec(); Q_ASSERT(job->exec());
} else { } else {
const auto job = new KeychainChunk::WriteJob(proxyPasswordKey, proxyPassword.toUtf8()); const auto job = new KeychainChunk::WriteJob(proxyPasswordKey, proxyPassword.toUtf8());
job->exec(); Q_ASSERT(job->exec());
} }
if (acc->_credentials) { if (acc->_credentials) {
@ -503,7 +503,7 @@ AccountPtr AccountManager::loadAccountHelper(QSettings &settings)
acc->setProxyPassword(password); acc->setProxyPassword(password);
} }
}); });
job->exec(); Q_ASSERT(job->exec());
// now the server cert, it is in the general group // now the server cert, it is in the general group
settings.beginGroup(QLatin1String(generalC)); settings.beginGroup(QLatin1String(generalC));