diff options
author | Kevin Ottens <kevin.ottens@nextcloud.com> | 2020-05-18 21:54:23 +0300 |
---|---|---|
committer | Michael Schuster <michael@schuster.ms> | 2020-05-20 04:54:41 +0300 |
commit | 712869db9a68025362798a4ff9ccc9f3e424a417 (patch) | |
tree | d29fb71b6a914e49bf770c5c623ef36f9018b145 /src/gui/creds | |
parent | 3d2de4fc408320d362d05fc9258449f67faccc4c (diff) |
Use auto to avoiding repeating type names
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Diffstat (limited to 'src/gui/creds')
-rw-r--r-- | src/gui/creds/httpcredentialsgui.cpp | 2 | ||||
-rw-r--r-- | src/gui/creds/keychainchunk.cpp | 8 | ||||
-rw-r--r-- | src/gui/creds/shibboleth/shibbolethwebview.cpp | 4 | ||||
-rw-r--r-- | src/gui/creds/shibbolethcredentials.cpp | 20 | ||||
-rw-r--r-- | src/gui/creds/webflowcredentials.cpp | 18 |
5 files changed, 26 insertions, 26 deletions
diff --git a/src/gui/creds/httpcredentialsgui.cpp b/src/gui/creds/httpcredentialsgui.cpp index a59d05ea5..cf8261c97 100644 --- a/src/gui/creds/httpcredentialsgui.cpp +++ b/src/gui/creds/httpcredentialsgui.cpp @@ -121,7 +121,7 @@ void HttpCredentialsGui::showDialog() dialog.setLabelText(msg); dialog.setTextValue(_previousPassword); dialog.setTextEchoMode(QLineEdit::Password); - if (QLabel *dialogLabel = dialog.findChild<QLabel *>()) { + if (auto *dialogLabel = dialog.findChild<QLabel *>()) { dialogLabel->setOpenExternalLinks(true); dialogLabel->setTextFormat(Qt::RichText); } diff --git a/src/gui/creds/keychainchunk.cpp b/src/gui/creds/keychainchunk.cpp index ceacd27d7..cd6d3257f 100644 --- a/src/gui/creds/keychainchunk.cpp +++ b/src/gui/creds/keychainchunk.cpp @@ -68,7 +68,7 @@ void WriteJob::start() void WriteJob::slotWriteJobDone(QKeychain::Job *incomingJob) { - QKeychain::WritePasswordJob *writeJob = static_cast<QKeychain::WritePasswordJob *>(incomingJob); + auto *writeJob = static_cast<QKeychain::WritePasswordJob *>(incomingJob); // errors? if (writeJob) { @@ -114,7 +114,7 @@ void WriteJob::slotWriteJobDone(QKeychain::Job *incomingJob) _key + (index > 0 ? (QString(".") + QString::number(index)) : QString()), _account->id()); - QKeychain::WritePasswordJob *job = new QKeychain::WritePasswordJob(_serviceName); + auto *job = new QKeychain::WritePasswordJob(_serviceName); #if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK) addSettingsToJob(_account, job); #endif @@ -158,7 +158,7 @@ void ReadJob::start() _key, _keychainMigration ? QString() : _account->id()); - QKeychain::ReadPasswordJob *job = new QKeychain::ReadPasswordJob(_serviceName); + auto *job = new QKeychain::ReadPasswordJob(_serviceName); #if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK) addSettingsToJob(_account, job); #endif @@ -171,7 +171,7 @@ void ReadJob::start() void ReadJob::slotReadJobDone(QKeychain::Job *incomingJob) { // Errors or next chunk? - QKeychain::ReadPasswordJob *readJob = static_cast<QKeychain::ReadPasswordJob *>(incomingJob); + auto *readJob = static_cast<QKeychain::ReadPasswordJob *>(incomingJob); if (readJob) { if (readJob->error() == NoError && readJob->binaryData().length() > 0) { diff --git a/src/gui/creds/shibboleth/shibbolethwebview.cpp b/src/gui/creds/shibboleth/shibbolethwebview.cpp index 8e4465b3c..1fb0a7b46 100644 --- a/src/gui/creds/shibboleth/shibbolethwebview.cpp +++ b/src/gui/creds/shibboleth/shibbolethwebview.cpp @@ -87,9 +87,9 @@ ShibbolethWebView::ShibbolethWebView(AccountPtr account, QWidget *parent) // open an additional window to display some cipher debug info QWebPage *debugPage = new UserAgentWebPage(this); debugPage->mainFrame()->load(QUrl("https://cc.dcsec.uni-hannover.de/")); - QWebView *debugView = new QWebView(this); + auto *debugView = new QWebView(this); debugView->setPage(debugPage); - QMainWindow *window = new QMainWindow(this); + auto *window = new QMainWindow(this); window->setWindowTitle(tr("SSL Cipher Debug View")); window->setCentralWidget(debugView); window->show(); diff --git a/src/gui/creds/shibbolethcredentials.cpp b/src/gui/creds/shibbolethcredentials.cpp index a9766f8c6..a09136a97 100644 --- a/src/gui/creds/shibbolethcredentials.cpp +++ b/src/gui/creds/shibbolethcredentials.cpp @@ -141,7 +141,7 @@ void ShibbolethCredentials::fetchFromKeychain() void ShibbolethCredentials::fetchFromKeychainHelper() { - ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName()); + auto *job = new ReadPasswordJob(Theme::instance()->appName()); job->setSettings(ConfigFile::settingsWithGroup(Theme::instance()->appName(), job).release()); job->setInsecureFallback(false); job->setKey(keychainKey(_url.toString(), user(), @@ -153,7 +153,7 @@ void ShibbolethCredentials::fetchFromKeychainHelper() void ShibbolethCredentials::askFromUser() { // First, we do a DetermineAuthTypeJob to make sure that the server is still using shibboleth and did not upgrade to oauth - DetermineAuthTypeJob *job = new DetermineAuthTypeJob(_account->sharedFromThis(), this); + auto *job = new DetermineAuthTypeJob(_account->sharedFromThis(), this); connect(job, &DetermineAuthTypeJob::authType, [this, job](DetermineAuthTypeJob::AuthType type) { if (type == DetermineAuthTypeJob::Shibboleth) { // Normal case, still shibboleth @@ -197,7 +197,7 @@ void ShibbolethCredentials::invalidateToken() { _ready = false; - CookieJar *jar = static_cast<CookieJar *>(_account->networkAccessManager()->cookieJar()); + auto *jar = static_cast<CookieJar *>(_account->networkAccessManager()->cookieJar()); // Remove the _shibCookie auto cookies = jar->allCookies(); @@ -234,7 +234,7 @@ void ShibbolethCredentials::slotFetchUser() { // We must first do a request to webdav so the session is enabled. // (because for some reason we can't access the API without that.. a bug in the server maybe?) - EntityExistsJob *job = new EntityExistsJob(_account->sharedFromThis(), _account->davPath(), this); + auto *job = new EntityExistsJob(_account->sharedFromThis(), _account->davPath(), this); connect(job, &EntityExistsJob::exists, this, &ShibbolethCredentials::slotFetchUserHelper); job->setIgnoreCredentialFailure(true); job->start(); @@ -242,7 +242,7 @@ void ShibbolethCredentials::slotFetchUser() void ShibbolethCredentials::slotFetchUserHelper() { - ShibbolethUserJob *job = new ShibbolethUserJob(_account->sharedFromThis(), this); + auto *job = new ShibbolethUserJob(_account->sharedFromThis(), this); connect(job, &ShibbolethUserJob::userFetched, this, &ShibbolethCredentials::slotUserFetched); job->start(); } @@ -287,7 +287,7 @@ void ShibbolethCredentials::slotReadJobDone(QKeychain::Job *job) } if (job->error() == QKeychain::NoError) { - ReadPasswordJob *readJob = static_cast<ReadPasswordJob *>(job); + auto *readJob = static_cast<ReadPasswordJob *>(job); delete readJob->settings(); QList<QNetworkCookie> cookies = QNetworkCookie::parseCookies(readJob->textData().toUtf8()); if (cookies.count() > 0) { @@ -310,7 +310,7 @@ void ShibbolethCredentials::slotReadJobDone(QKeychain::Job *job) if (_keychainMigration && _ready) { persist(); - DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName()); + auto *job = new DeletePasswordJob(Theme::instance()->appName()); job->setSettings(ConfigFile::settingsWithGroup(Theme::instance()->appName(), job).release()); job->setKey(keychainKey(_account->url().toString(), user(), QString())); job->start(); @@ -326,7 +326,7 @@ void ShibbolethCredentials::showLoginWindow() return; } - CookieJar *jar = static_cast<CookieJar *>(_account->networkAccessManager()->cookieJar()); + auto *jar = static_cast<CookieJar *>(_account->networkAccessManager()->cookieJar()); // When opening a new window clear all the session cookie that might keep the user from logging in // (or the session may already be open in the server, and there will not be redirect asking for the // real long term cookie we want to store) @@ -366,7 +366,7 @@ QByteArray ShibbolethCredentials::shibCookieName() void ShibbolethCredentials::storeShibCookie(const QNetworkCookie &cookie) { - WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName()); + auto *job = new WritePasswordJob(Theme::instance()->appName()); job->setSettings(ConfigFile::settingsWithGroup(Theme::instance()->appName(), job).release()); // we don't really care if it works... //connect(job, SIGNAL(finished(QKeychain::Job*)), SLOT(slotWriteJobDone(QKeychain::Job*))); @@ -377,7 +377,7 @@ void ShibbolethCredentials::storeShibCookie(const QNetworkCookie &cookie) void ShibbolethCredentials::removeShibCookie() { - DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName()); + auto *job = new DeletePasswordJob(Theme::instance()->appName()); job->setSettings(ConfigFile::settingsWithGroup(Theme::instance()->appName(), job).release()); job->setKey(keychainKey(_account->url().toString(), user(), _account->id())); job->start(); diff --git a/src/gui/creds/webflowcredentials.cpp b/src/gui/creds/webflowcredentials.cpp index fb85fc5d2..16d4ccd62 100644 --- a/src/gui/creds/webflowcredentials.cpp +++ b/src/gui/creds/webflowcredentials.cpp @@ -152,7 +152,7 @@ void WebFlowCredentials::fetchFromKeychain() { void WebFlowCredentials::askFromUser() { // Determine if the old flow has to be used (GS for now) // Do a DetermineAuthTypeJob to make sure that the server is still using Flow2 - DetermineAuthTypeJob *job = new DetermineAuthTypeJob(_account->sharedFromThis(), this); + auto *job = new DetermineAuthTypeJob(_account->sharedFromThis(), this); connect(job, &DetermineAuthTypeJob::authType, [this](DetermineAuthTypeJob::AuthType type) { // LoginFlowV2 > WebViewFlow > OAuth > Shib > Basic bool useFlow2 = (type != DetermineAuthTypeJob::WebViewFlow); @@ -340,7 +340,7 @@ void WebFlowCredentials::slotWriteClientCaCertsPEMJobDone(KeychainChunk::WriteJo } // done storing ca certs, time for the password - WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName()); + auto *job = new WritePasswordJob(Theme::instance()->appName()); #if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK) addSettingsToJob(_account, job); #endif @@ -360,7 +360,7 @@ void WebFlowCredentials::slotWriteJobDone(QKeychain::Job *job) default: qCWarning(lcWebFlowCredentials) << "Error while writing password" << job->errorString(); } - WritePasswordJob *wjob = qobject_cast<WritePasswordJob *>(job); + auto *wjob = qobject_cast<WritePasswordJob *>(job); wjob->deleteLater(); } @@ -390,11 +390,11 @@ void WebFlowCredentials::forgetSensitiveData() { return; } - DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName()); + auto *job = new DeletePasswordJob(Theme::instance()->appName()); job->setInsecureFallback(false); job->setKey(kck); connect(job, &Job::finished, this, [](QKeychain::Job *job) { - DeletePasswordJob *djob = qobject_cast<DeletePasswordJob *>(job); + auto *djob = qobject_cast<DeletePasswordJob *>(job); djob->deleteLater(); }); job->start(); @@ -565,7 +565,7 @@ void WebFlowCredentials::slotReadClientCaCertsPEMJobDone(KeychainChunk::ReadJob _user, _keychainMigration ? QString() : _account->id()); - ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName()); + auto *job = new ReadPasswordJob(Theme::instance()->appName()); #if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK) addSettingsToJob(_account, job); #endif @@ -576,7 +576,7 @@ void WebFlowCredentials::slotReadClientCaCertsPEMJobDone(KeychainChunk::ReadJob } void WebFlowCredentials::slotReadPasswordJobDone(Job *incomingJob) { - QKeychain::ReadPasswordJob *job = qobject_cast<ReadPasswordJob *>(incomingJob); + auto *job = qobject_cast<ReadPasswordJob *>(incomingJob); QKeychain::Error error = job->error(); // If we could not find the entry try the old entries @@ -612,7 +612,7 @@ void WebFlowCredentials::slotReadPasswordJobDone(Job *incomingJob) { void WebFlowCredentials::deleteKeychainEntries(bool oldKeychainEntries) { auto startDeleteJob = [this, oldKeychainEntries](QString key) { - DeletePasswordJob *job = new DeletePasswordJob(Theme::instance()->appName()); + auto *job = new DeletePasswordJob(Theme::instance()->appName()); #if defined(KEYCHAINCHUNK_ENABLE_INSECURE_FALLBACK) addSettingsToJob(_account, job); #endif @@ -622,7 +622,7 @@ void WebFlowCredentials::deleteKeychainEntries(bool oldKeychainEntries) { oldKeychainEntries ? QString() : _account->id())); connect(job, &Job::finished, this, [](QKeychain::Job *job) { - DeletePasswordJob *djob = qobject_cast<DeletePasswordJob *>(job); + auto *djob = qobject_cast<DeletePasswordJob *>(job); djob->deleteLater(); }); job->start(); |