diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2017-12-13 21:44:22 +0100 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2017-12-14 17:01:34 +0100 |
commit | c21e99827759413421040fd16d626f9b503bd2a5 (patch) | |
tree | 13b09cf413fd34cbb5aea4f2261fb3b89638af2b /mobile-widgets | |
parent | 074ddc05962e643b129cacbe81a20640cfd8fe19 (diff) | |
download | subsurface-c21e99827759413421040fd16d626f9b503bd2a5.tar.gz |
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>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 37254f7cf..1e56e444c 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -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 |