Merge informational_prefs into git_prefs

There is no need to have two variables for the same purpose.

[Dirk Hohndel: changed to keep the two separate functions as otherwise
               we no longer parse existing repos successfully]

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Joakim Bygdell 2017-02-04 17:55:25 +01:00 committed by Dirk Hohndel
parent 12c33a038f
commit 0277d5aacc
5 changed files with 39 additions and 26 deletions

View file

@ -151,10 +151,10 @@ void QMLManager::openLocalThenRemote(QString url)
// if we can load from the cache, we know that we have at least a valid email
if (credentialStatus() == UNKNOWN)
setCredentialStatus(VALID_EMAIL);
prefs.unit_system = informational_prefs.unit_system;
if (informational_prefs.unit_system == IMPERIAL)
informational_prefs.units = IMPERIAL_units;
prefs.units = informational_prefs.units;
prefs.unit_system = git_prefs.unit_system;
if (git_prefs.unit_system == IMPERIAL)
git_prefs.units = IMPERIAL_units;
prefs.units = git_prefs.units;
prefs.tankbar = git_prefs.tankbar;
prefs.dcceiling = git_prefs.dcceiling;
process_dives(false, false);
@ -538,10 +538,10 @@ void QMLManager::revertToNoCloudIfNeeded()
void QMLManager::consumeFinishedLoad(timestamp_t currentDiveTimestamp)
{
prefs.unit_system = informational_prefs.unit_system;
if (informational_prefs.unit_system == IMPERIAL)
informational_prefs.units = IMPERIAL_units;
prefs.units = informational_prefs.units;
prefs.unit_system = git_prefs.unit_system;
if (git_prefs.unit_system == IMPERIAL)
git_prefs.units = IMPERIAL_units;
prefs.units = git_prefs.units;
prefs.tankbar = git_prefs.tankbar;
prefs.dcceiling = git_prefs.dcceiling;
DiveListModel::instance()->clear();