Settings update: Clean up save user id local

So, prefs.save_userid_local is being set outside of
a preferences set (it's set to true and false while
loading the files via xml or git) and because of that
I had to bypass a few method calls.

When something triggers a preferences change, the
application will be notified that the preferences
changed, thing that I couldn't do while reading the
xml or git because that should be local-only.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2016-08-10 13:27:03 -03:00 committed by Dirk Hohndel
parent 048379cc2b
commit 81d5d82b7b
7 changed files with 36 additions and 35 deletions

View file

@ -811,6 +811,17 @@ void CloudStorageSettings::setBackgroundSync(bool value)
emit backgroundSyncChanged(value);
}
void CloudStorageSettings::setSaveUserIdLocal(short int value)
{
prefs.save_userid_local = value;
emit saveUserIdLocalChanged(value);
}
short int CloudStorageSettings::saveUserIdLocal() const
{
return prefs.save_userid_local;
}
void CloudStorageSettings::setBaseUrl(const QString& value)
{
free((void*)prefs.cloud_base_url);
@ -1621,17 +1632,6 @@ QObject(parent),
{
}
void SettingsObjectWrapper::setSaveUserIdLocal(short int value)
{
Q_UNUSED(value);
//TODO: Find where this is stored on the preferences.
}
short int SettingsObjectWrapper::saveUserIdLocal() const
{
return prefs.save_userid_local;
}
SettingsObjectWrapper* SettingsObjectWrapper::instance()
{
static SettingsObjectWrapper settings;