mobile: only deal with localrepo in NOCLOUD mode

This is a very subtile bug. Testing/developing on the desktop for mobile,
with a normal logbook in a git repo, resulted in a surprising effect.
When swichting from a cloud account to a NOCLOUD situation, the no cloud
repo was (not always) reset to the NOCLOUD_LOCALSTORAGE, but to the
normal logbook. Resuling in commits in the wrong repo.

This can easily be solved by setting the filename to NOCLOUD_LOCALSTORAGE,
when switching to NOCLOUD mode.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2017-09-27 18:27:12 +02:00 committed by Dirk Hohndel
parent 6ea3fd3d92
commit 85dfdaa3e5

View file

@ -1413,8 +1413,10 @@ QMLManager::cloud_status_qml QMLManager::credentialStatus() const
void QMLManager::setCredentialStatus(const cloud_status_qml value)
{
if (m_credentialStatus != value) {
if (value == CS_NOCLOUD)
if (value == CS_NOCLOUD) {
appendTextToLog("Switching to no cloud mode");
set_filename(NOCLOUD_LOCALSTORAGE, true);
}
m_credentialStatus = value;
emit credentialStatusChanged();
}