[Pkg-owncloud-commits] [owncloud-client] 18/484: Remove *Credentials::_fetchJobInProgress

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:04 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 128d46e19a4246364af4d361e3c570982a43fb7d
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date:   Sat Sep 5 15:51:11 2015 +0200

    Remove *Credentials::_fetchJobInProgress
    
    Now that fetchFromKeychain is solely called from AccountState::slotInvalidCredentials
    and that this one already protects the fetch call using _waitingForNewCredentials,
    we can remove that extra check.
---
 src/gui/creds/shibbolethcredentials.cpp | 13 -------------
 src/gui/creds/shibbolethcredentials.h   |  1 -
 src/libsync/creds/httpcredentials.cpp   | 13 ++-----------
 src/libsync/creds/httpcredentials.h     |  1 -
 4 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/src/gui/creds/shibbolethcredentials.cpp b/src/gui/creds/shibbolethcredentials.cpp
index 12b9b7d..0a1cac4 100644
--- a/src/gui/creds/shibbolethcredentials.cpp
+++ b/src/gui/creds/shibbolethcredentials.cpp
@@ -51,14 +51,12 @@ ShibbolethCredentials::ShibbolethCredentials()
       _url(),
       _ready(false),
       _stillValid(false),
-      _fetchJobInProgress(false),
       _browser(0)
 {}
 
 ShibbolethCredentials::ShibbolethCredentials(const QNetworkCookie& cookie)
   : _ready(true),
     _stillValid(true),
-    _fetchJobInProgress(false),
     _browser(0),
     _shibCookie(cookie)
 {
@@ -153,15 +151,10 @@ bool ShibbolethCredentials::ready() const
 
 void ShibbolethCredentials::fetchFromKeychain()
 {
-    if(_fetchJobInProgress) {
-        return;
-    }
-
     if (_user.isEmpty()) {
         _user = _account->credentialSetting(QLatin1String(userC)).toString();
     }
     if (_ready) {
-        _fetchJobInProgress = false;
         Q_EMIT fetched();
     } else {
         _url = _account->url();
@@ -171,7 +164,6 @@ void ShibbolethCredentials::fetchFromKeychain()
         job->setKey(keychainKey(_account->url().toString(), "shibAssertion"));
         connect(job, SIGNAL(finished(QKeychain::Job*)), SLOT(slotReadJobDone(QKeychain::Job*)));
         job->start();
-        _fetchJobInProgress = true;
     }
 }
 
@@ -197,7 +189,6 @@ void ShibbolethCredentials::persist()
 void ShibbolethCredentials::invalidateToken()
 {
     _ready = false;
-    _fetchJobInProgress = true;
 
     CookieJar *jar = static_cast<CookieJar*>(_account->networkAccessManager()->cookieJar());
 
@@ -263,7 +254,6 @@ void ShibbolethCredentials::slotUserFetched(const QString &user)
 
     _stillValid = true;
     _ready = true;
-    _fetchJobInProgress = false;
     Q_EMIT asked();
 }
 
@@ -271,7 +261,6 @@ void ShibbolethCredentials::slotUserFetched(const QString &user)
 void ShibbolethCredentials::slotBrowserRejected()
 {
     _ready = false;
-    _fetchJobInProgress = false;
     Q_EMIT asked();
 }
 
@@ -290,11 +279,9 @@ void ShibbolethCredentials::slotReadJobDone(QKeychain::Job *job)
 
         _ready = true;
         _stillValid = true;
-        _fetchJobInProgress = false;
         Q_EMIT fetched();
     } else {
         _ready = false;
-        _fetchJobInProgress = false;
         Q_EMIT fetched();
     }
 }
diff --git a/src/gui/creds/shibbolethcredentials.h b/src/gui/creds/shibbolethcredentials.h
index 19bbbb2..99ecdac 100644
--- a/src/gui/creds/shibbolethcredentials.h
+++ b/src/gui/creds/shibbolethcredentials.h
@@ -88,7 +88,6 @@ private:
 
     bool _ready;
     bool _stillValid;
-    bool _fetchJobInProgress;
     QPointer<ShibbolethWebView> _browser;
     QNetworkCookie _shibCookie;
     QString _user;
diff --git a/src/libsync/creds/httpcredentials.cpp b/src/libsync/creds/httpcredentials.cpp
index cfeba26..f31265a 100644
--- a/src/libsync/creds/httpcredentials.cpp
+++ b/src/libsync/creds/httpcredentials.cpp
@@ -82,8 +82,7 @@ const char authenticationFailedC[] = "owncloud-authentication-failed";
 } // ns
 
 HttpCredentials::HttpCredentials()
-    : _ready(false),
-      _fetchJobInProgress(false)
+    : _ready(false)
 {
 }
 
@@ -92,8 +91,7 @@ HttpCredentials::HttpCredentials(const QString& user, const QString& password, c
       _password(password),
       _ready(true),
       _certificatePath(certificatePath),
-      _certificatePasswd(certificatePasswd),
-      _fetchJobInProgress(false)
+      _certificatePasswd(certificatePasswd)
 {
 }
 
@@ -197,11 +195,6 @@ QString HttpCredentials::fetchUser()
 
 void HttpCredentials::fetchFromKeychain()
 {
-    // FIXME: Should this check go if we check in AccountState instead?
-    if (_fetchJobInProgress) {
-        return;
-    }
-
     // User must be fetched from config file
     fetchUser();
     _certificatePath = _account->credentialSetting(QLatin1String(certifPathC)).toString();
@@ -231,7 +224,6 @@ void HttpCredentials::fetchFromKeychain()
         job->setKey(kck);
         connect(job, SIGNAL(finished(QKeychain::Job*)), SLOT(slotReadJobDone(QKeychain::Job*)));
         job->start();
-        _fetchJobInProgress = true;
     }
 }
 bool HttpCredentials::stillValid(QNetworkReply *reply)
@@ -250,7 +242,6 @@ void HttpCredentials::slotReadJobDone(QKeychain::Job *job)
 
     QKeychain::Error error = job->error();
 
-    _fetchJobInProgress = false;
     if( !_password.isEmpty() && error == NoError ) {
 
         // All cool, the keychain did not come back with error.
diff --git a/src/libsync/creds/httpcredentials.h b/src/libsync/creds/httpcredentials.h
index bbd0a3d..ce3d9c4 100644
--- a/src/libsync/creds/httpcredentials.h
+++ b/src/libsync/creds/httpcredentials.h
@@ -73,7 +73,6 @@ protected:
 private:
     QString _certificatePath;
     QString _certificatePasswd;
-    bool _fetchJobInProgress; //True if the keychain job is in progress or the input dialog visible
 };
 
 } // namespace OCC

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list