QML UI: make sure nothing is lost when changing cloud credentials

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-04-29 05:04:47 -07:00
parent 9ca0f7334b
commit f536da0ee3

View file

@ -253,6 +253,9 @@ void QMLManager::saveCloudCredentials()
if (cloudUserName().isEmpty() || cloudPassword().isEmpty()) {
setStartPageText(RED_FONT + tr("Please enter valid cloud credentials.") + END_FONT);
} else if (cloudCredentialsChanged) {
// let's make sure there are no unsaved changes
saveChangesLocal();
free(prefs.userid);
prefs.userid = NULL;
syncLoadFromCloud();