summaryrefslogtreecommitdiffstats
path: root/core/cloudstorage.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-10 06:49:14 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-10 16:26:49 -0700
commit2b3f6c607bf5eb7c6b24160832ba83ed60dca543 (patch)
treeba38e074a9fbad112dab25616a804e17e7b248ff /core/cloudstorage.cpp
parentae653703a5d3ff1da84053d4542420fc70325c5f (diff)
downloadsubsurface-2b3f6c607bf5eb7c6b24160832ba83ed60dca543.tar.gz
prefs: cloud_new_password is not a preference
It's a mamber of the cloud storage authentication class, used to hold the proposed new password until the backend has accepted it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/cloudstorage.cpp')
-rw-r--r--core/cloudstorage.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/cloudstorage.cpp b/core/cloudstorage.cpp
index 51bdf5994..24a536992 100644
--- a/core/cloudstorage.cpp
+++ b/core/cloudstorage.cpp
@@ -26,6 +26,7 @@ QNetworkReply* CloudStorageAuthenticate::backend(const QString& email,const QStr
} else if (!newpasswd.isEmpty()) {
requestUrl = QUrl(CLOUDBACKENDUPDATE);
payload += QChar(' ') + newpasswd;
+ cloudNewPassword = newpasswd;
} else {
requestUrl = QUrl(CLOUDBACKENDVERIFY);
payload += QChar(' ') + pin;
@@ -64,8 +65,8 @@ void CloudStorageAuthenticate::uploadFinished()
report_error(qPrintable(tr("Cloud account verification required, enter PIN in preferences")));
} else if (cloudAuthReply == QLatin1String("[PASSWDCHANGED]")) {
free((void *)prefs.cloud_storage_password);
- prefs.cloud_storage_password = prefs.cloud_storage_newpassword;
- prefs.cloud_storage_newpassword = NULL;
+ prefs.cloud_storage_password = strdup(qPrintable(cloudNewPassword));
+ cloudNewPassword.clear();
emit passwordChangeSuccessful();
return;
} else {