[Pkg-owncloud-commits] [owncloud-client] 09/30: Do not erase the username and password from the config if we never connected

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Mar 15 21:28:29 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 eeb68919bffdb01722eb7736ba61fb606de7a5ea
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Fri Feb 28 12:47:54 2014 +0100

    Do not erase the username and password from the config if we never connected
    
    If we never fetched the credidentials, the _user and _password will be empty,
    we should therefore not try to save them because it would just erase them.
    
    Version 1.5.2 always try to fetch the creds at startup.  But now we only
    do it if we detect an internet connection
---
 src/creds/httpcredentials.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/creds/httpcredentials.cpp b/src/creds/httpcredentials.cpp
index f3bb67d..736c299 100644
--- a/src/creds/httpcredentials.cpp
+++ b/src/creds/httpcredentials.cpp
@@ -287,6 +287,10 @@ void HttpCredentials::invalidateToken(Account *account)
 
 void HttpCredentials::persist(Account *account)
 {
+    if (_user.isEmpty()) {
+        // We never connected or fetched the user, there is nothing to save.
+        return;
+    }
     account->setCredentialSetting(QLatin1String(userC), _user);
     WritePasswordJob *job = new WritePasswordJob(Theme::instance()->appName());
     job->setInsecureFallback(false);

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