mobile: do not go to NO_CLOUD status from UNKNOWN

In case the credential status is UNKNOWN, and the cloud username
and password are empty, do not go automatically to NO_CLOUD status.
This is (again) preparation for future work on credential management.

For example, the user entered an email address with a spelling
error, so does not receive a PIN code email. This user needs a
way out, so there needs to be a <cancel> button on the PIN code
screen. And the most logic was of cancelling is emptying the
entered username/passwd and let the user try again.

Without this change, the user immediately gets into the (somewhat)
final NO_CLOUD state, which will result in (very) confused users.

With this change, there is exacly one way (left) to get into a
NO_CLOUD setup: hitting the proper button, so a deliberate user
action.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2017-09-26 17:26:54 +02:00 committed by Dirk Hohndel
parent 2e91de9d95
commit 46f10362fc

View file

@ -231,7 +231,7 @@ void QMLManager::finishSetup()
// but we need to make sure we stay the only ones accessing git storage
alreadySaving = true;
openLocalThenRemote(url);
} else if (!same_string(existing_filename, "")) {
} else if (!same_string(existing_filename, "") && credentialStatus() != CS_UNKNOWN) {
setCredentialStatus(CS_NOCLOUD);
appendTextToLog(tr("working in no-cloud mode"));
int error = parse_file(existing_filename);