From 1a26f97d7daeb45ec57e6ceb553701a5a09e8495 Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Mon, 28 Oct 2024 20:27:53 +0100 Subject: [PATCH] User const auto. Signed-off-by: Camila Ayres --- src/gui/creds/webflowcredentials.cpp | 2 +- src/gui/wizard/owncloudadvancedsetuppage.cpp | 4 ++-- src/libsync/account.cpp | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gui/creds/webflowcredentials.cpp b/src/gui/creds/webflowcredentials.cpp index 072753cace372..0495d3b888a2e 100644 --- a/src/gui/creds/webflowcredentials.cpp +++ b/src/gui/creds/webflowcredentials.cpp @@ -355,7 +355,7 @@ void WebFlowCredentials::forgetSensitiveData() { _account->deleteAppPassword(); - const QString kck = keychainKey(_account->url().toString(), _user, _account->id()); + const auto kck = keychainKey(_account->url().toString(), _user, _account->id()); if (kck.isEmpty()) { qCDebug(lcWebFlowCredentials()) << "InvalidateToken: User is empty, bailing out!"; return; diff --git a/src/gui/wizard/owncloudadvancedsetuppage.cpp b/src/gui/wizard/owncloudadvancedsetuppage.cpp index f242db0d3367e..08017098100c1 100644 --- a/src/gui/wizard/owncloudadvancedsetuppage.cpp +++ b/src/gui/wizard/owncloudadvancedsetuppage.cpp @@ -355,8 +355,8 @@ void OwncloudAdvancedSetupPage::stopSpinner() QUrl OwncloudAdvancedSetupPage::serverUrl() const { - const QString urlString = dynamic_cast(wizard())->ocUrl(); - const QString user = dynamic_cast(wizard())->getCredentials()->user(); + const auto urlString = dynamic_cast(wizard())->ocUrl(); + const auto user = dynamic_cast(wizard())->getCredentials()->user(); QUrl url(urlString); url.setUserName(user); diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp index 16a5263c2cc1e..7f9d93c938abe 100644 --- a/src/libsync/account.cpp +++ b/src/libsync/account.cpp @@ -358,7 +358,7 @@ QUrl Account::deprecatedPrivateLinkUrl(const QByteArray &numericFileId) const */ void Account::clearCookieJar() { - auto jar = qobject_cast(_am->cookieJar()); + const auto jar = qobject_cast(_am->cookieJar()); ASSERT(jar); jar->setAllCookies(QList()); } @@ -529,11 +529,12 @@ void Account::setUserVisibleHost(const QString &host) QVariant Account::credentialSetting(const QString &key) const { if (_credentials) { - QString prefix = _credentials->authType(); - QVariant value = _settingsMap.value(prefix + "_" + key); + const auto prefix = _credentials->authType(); + auto value = _settingsMap.value(prefix + "_" + key); if (value.isNull()) { value = _settingsMap.value(key); } + return value; } return QVariant(); @@ -828,9 +829,10 @@ void Account::writeAppPasswordOnce(QString appPassword){ } void Account::retrieveAppPassword(){ + const QString key = credentials()->user() + app_password; const QString kck = AbstractCredentials::keychainKey( url().toString(), - credentials()->user() + app_password, + key, id() );