[Pkg-owncloud-commits] [owncloud-client] 13/484: Remove the _readPwdFromDeprecatedPlace codepath

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:02 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 628957de21d5e03e29182d21b9fa8a0f85f164cb
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date:   Sun Aug 30 12:08:40 2015 +0200

    Remove the _readPwdFromDeprecatedPlace codepath
    
    This was introduced in 1.6.2 to read the password from earlier versions.
    People upgrading from 1.5 to 2.1 will sadly need to re-enter their password.
---
 src/libsync/creds/httpcredentials.cpp | 56 ++++++++++++-----------------------
 src/libsync/creds/httpcredentials.h   |  1 -
 2 files changed, 19 insertions(+), 38 deletions(-)

diff --git a/src/libsync/creds/httpcredentials.cpp b/src/libsync/creds/httpcredentials.cpp
index ba2c6e4..32c4745 100644
--- a/src/libsync/creds/httpcredentials.cpp
+++ b/src/libsync/creds/httpcredentials.cpp
@@ -87,8 +87,7 @@ HttpCredentials::HttpCredentials()
       _certificatePath(),
       _certificatePasswd(),
       _ready(false),
-      _fetchJobInProgress(false),
-      _readPwdFromDeprecatedPlace(false)
+      _fetchJobInProgress(false)
 {
 }
 
@@ -236,7 +235,6 @@ void HttpCredentials::fetch()
         connect(job, SIGNAL(finished(QKeychain::Job*)), SLOT(slotReadJobDone(QKeychain::Job*)));
         job->start();
         _fetchJobInProgress = true;
-        _readPwdFromDeprecatedPlace = true;
     }
 }
 bool HttpCredentials::stillValid(QNetworkReply *reply)
@@ -268,42 +266,26 @@ void HttpCredentials::slotReadJobDone(QKeychain::Job *job)
         // error happend.
         // In all error conditions it should
         // ask the user for the password interactively now.
-        if( _readPwdFromDeprecatedPlace ) {
-            // there simply was not a password. Lets restart a read job without
-            // a settings object as we did it in older client releases.
-            ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
-
-            const QString kck = keychainKey(_account->url().toString(), _user);
-            job->setKey(kck);
-
-            connect(job, SIGNAL(finished(QKeychain::Job*)), SLOT(slotReadJobDone(QKeychain::Job*)));
-            job->start();
-            _readPwdFromDeprecatedPlace = false; // do  try that only once.
-            _fetchJobInProgress = true;
-            // Note: if this read job succeeds, the value from the old place is still
-            // NOT persisted into the new account.
+        // interactive password dialog starts here
+
+        QString hint;
+        if (job->error() != EntryNotFound) {
+            hint = tr("Reading from keychain failed with error: '%1'").arg(
+                    job->errorString());
+        }
+
+        bool ok;
+        QString pwd = queryPassword(&ok, hint);
+        _fetchJobInProgress = false;
+        if (ok) {
+            _password = pwd;
+            _ready = true;
+            persist();
         } else {
-            // interactive password dialog starts here
-
-            QString hint;
-            if (job->error() != EntryNotFound) {
-                hint = tr("Reading from keychain failed with error: '%1'").arg(
-                        job->errorString());
-            }
-
-            bool ok;
-            QString pwd = queryPassword(&ok, hint);
-            _fetchJobInProgress = false;
-            if (ok) {
-                _password = pwd;
-                _ready = true;
-                persist();
-            } else {
-                _password = QString::null;
-                _ready = false;
-            }
-            emit fetched();
+            _password = QString::null;
+            _ready = false;
         }
+        emit fetched();
     }
 }
 
diff --git a/src/libsync/creds/httpcredentials.h b/src/libsync/creds/httpcredentials.h
index 95c6ba4..14674a9 100644
--- a/src/libsync/creds/httpcredentials.h
+++ b/src/libsync/creds/httpcredentials.h
@@ -74,7 +74,6 @@ private:
     QString _certificatePasswd;
     bool _ready;
     bool _fetchJobInProgress; //True if the keychain job is in progress or the input dialog visible
-    bool _readPwdFromDeprecatedPlace;
 };
 
 } // 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