Don't create GeneralSettingsObjectWrapper object

Instead use the application-wide instance. Creating a local
object defeats the whole purpose of these objects - nobody
can receive signals in case the settings changed.

No other cases of locally created SettingsObjectWrapper
objects were found.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2017-12-13 21:44:22 +01:00 committed by Jan Mulder
parent 074ddc0596
commit c21e998277

View file

@ -1104,9 +1104,9 @@ void QMLManager::openNoCloudRepo()
if (git_create_local_repo(filename))
appendTextToLog(get_error_string());
set_filename(filename);
GeneralSettingsObjectWrapper s(this);
s.setDefaultFilename(filename);
s.setDefaultFileBehavior(LOCAL_DEFAULT_FILE);
auto s = SettingsObjectWrapper::instance()->general_settings;
s->setDefaultFilename(filename);
s->setDefaultFileBehavior(LOCAL_DEFAULT_FILE);
}
openLocalThenRemote(filename);
@ -1121,9 +1121,9 @@ void QMLManager::saveChangesLocal()
if (git_create_local_repo(filename))
appendTextToLog(get_error_string());
set_filename(filename);
GeneralSettingsObjectWrapper s(this);
s.setDefaultFilename(filename);
s.setDefaultFileBehavior(LOCAL_DEFAULT_FILE);
auto s = SettingsObjectWrapper::instance()->general_settings;
s->setDefaultFilename(filename);
s->setDefaultFileBehavior(LOCAL_DEFAULT_FILE);
}
} else if (!loadFromCloud()) {
// this seems silly, but you need a common ancestor in the repository in