Skip to content

Commit

Permalink
tidy code
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien committed Jun 23, 2023
1 parent afefc72 commit 4accfac
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/libsync/clientsideencryption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ void ClientSideEncryption::fetchCertificateFromKeyChain(const AccountPtr &accoun
account->id()
);

auto *job = new ReadPasswordJob(Theme::instance()->appName());
const auto job = new ReadPasswordJob(Theme::instance()->appName());
job->setProperty(accountProperty, QVariant::fromValue(account));
job->setInsecureFallback(false);
job->setKey(kck);
Expand Down Expand Up @@ -1011,8 +1011,8 @@ void ClientSideEncryption::publicCertificateFetched(Job *incoming)

void ClientSideEncryption::publicKeyFetched(QKeychain::Job *incoming)
{
auto *readJob = dynamic_cast<ReadPasswordJob *>(incoming);
auto account = readJob->property(accountProperty).value<AccountPtr>();
const auto readJob = dynamic_cast<ReadPasswordJob *>(incoming);
const auto account = readJob->property(accountProperty).value<AccountPtr>();
Q_ASSERT(account);

// Error or no valid public key error out
Expand All @@ -1038,7 +1038,7 @@ void ClientSideEncryption::publicKeyFetched(QKeychain::Job *incoming)
account->id()
);

auto *job = new ReadPasswordJob(Theme::instance()->appName());
const auto job = new ReadPasswordJob(Theme::instance()->appName());
job->setProperty(accountProperty, QVariant::fromValue(account));
job->setInsecureFallback(false);
job->setKey(kck);
Expand Down Expand Up @@ -1146,7 +1146,7 @@ void ClientSideEncryption::writeCertificate(const AccountPtr &account)

void ClientSideEncryption::generateMnemonic()
{
QStringList list = WordList::getRandomWords(12);
const auto list = WordList::getRandomWords(12);
_mnemonic = list.join(' ');
qCInfo(lcCse()) << "mnemonic Generated:" << _mnemonic;
}
Expand Down Expand Up @@ -1483,7 +1483,7 @@ void ClientSideEncryption::writeKeyPair(AccountPtr account,
}
const auto bytearrayPrivateKey = BIO2ByteArray(privateKey);

auto *privateKeyJob = new WritePasswordJob(Theme::instance()->appName());
const auto privateKeyJob = new WritePasswordJob(Theme::instance()->appName());
privateKeyJob->setInsecureFallback(false);
privateKeyJob->setKey(privateKeyKeychainId);
privateKeyJob->setBinaryData(bytearrayPrivateKey);
Expand All @@ -1504,7 +1504,7 @@ void ClientSideEncryption::writeKeyPair(AccountPtr account,

const auto bytearrayPublicKey = BIO2ByteArray(publicKey);

auto *publicKeyJob = new WritePasswordJob(Theme::instance()->appName());
const auto publicKeyJob = new WritePasswordJob(Theme::instance()->appName());
publicKeyJob->setInsecureFallback(false);
publicKeyJob->setKey(publicKeyKeychainId);
publicKeyJob->setBinaryData(bytearrayPublicKey);
Expand Down

0 comments on commit 4accfac

Please sign in to comment.