[Pkg-owncloud-commits] [owncloud-client] 19/30: Only removes the password from the credidentials if it has been fetched before

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Mar 15 21:28:30 UTC 2014


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 6df00ad08ccbce04cceba80f89571e6b14ebd6a8
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Mar 3 17:55:15 2014 +0100

    Only removes the password from the credidentials if it has been fetched before
    
    Also only run the propfind job if the credidentials are readon, and fetch them
    otherwise
---
 src/mirall/connectionvalidator.cpp | 13 ++++++++++++-
 src/mirall/networkjobs.cpp         |  6 +++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/mirall/connectionvalidator.cpp b/src/mirall/connectionvalidator.cpp
index a64a231..0a38b7d 100644
--- a/src/mirall/connectionvalidator.cpp
+++ b/src/mirall/connectionvalidator.cpp
@@ -19,6 +19,7 @@
 #include "mirall/theme.h"
 #include "mirall/account.h"
 #include "mirall/networkjobs.h"
+#include <creds/abstractcredentials.h>
 
 namespace Mirall {
 
@@ -108,7 +109,14 @@ void ConnectionValidator::slotStatusFound(const QUrl&url, const QVariantMap &inf
         return;
     }
 
-    QTimer::singleShot( 0, this, SLOT( slotCheckAuthentication() ));
+    AbstractCredentials *creds = _account->credentials();
+    if (creds->ready()) {
+        QTimer::singleShot( 0, this, SLOT( slotCheckAuthentication() ));
+    } else {
+        connect( creds, SIGNAL(fetched()),
+                 this, SLOT(slotCheckAuthentication()), Qt::UniqueConnection);
+        creds->fetch(_account);
+    }
 }
 
 // status.php could not be loaded.
@@ -126,6 +134,9 @@ void ConnectionValidator::slotNoStatusFound(QNetworkReply *reply)
 
 void ConnectionValidator::slotCheckAuthentication()
 {
+    AbstractCredentials *creds = _account->credentials();
+    disconnect( creds, SIGNAL(fetched()),
+                this, SLOT(slotCheckAuthentication()));
     // simply GET the webdav root, will fail if credentials are wrong.
     // continue in slotAuthCheck here :-)
     PropfindJob *job = new PropfindJob(_account, "/", this);
diff --git a/src/mirall/networkjobs.cpp b/src/mirall/networkjobs.cpp
index 040d0f1..5f40a4a 100644
--- a/src/mirall/networkjobs.cpp
+++ b/src/mirall/networkjobs.cpp
@@ -151,7 +151,11 @@ void AbstractNetworkJob::slotFinished()
         // but try to re-sign in.
         connect( creds, SIGNAL(fetched()),
                  qApp, SLOT(slotCredentialsFetched()), Qt::UniqueConnection);
-        creds->invalidateAndFetch(_account);   // this triggers Application::runValidator when the credidentials are fetched
+        if (creds->ready()) {
+            creds->invalidateAndFetch(_account);
+        } else {
+            creds->fetch(_account);
+        }
     }
     deleteLater();
 }

-- 
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