mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
074ddc0596
commit
c21e998277
1 changed files with 6 additions and 6 deletions
|
@ -1104,9 +1104,9 @@ void QMLManager::openNoCloudRepo()
|
||||||
if (git_create_local_repo(filename))
|
if (git_create_local_repo(filename))
|
||||||
appendTextToLog(get_error_string());
|
appendTextToLog(get_error_string());
|
||||||
set_filename(filename);
|
set_filename(filename);
|
||||||
GeneralSettingsObjectWrapper s(this);
|
auto s = SettingsObjectWrapper::instance()->general_settings;
|
||||||
s.setDefaultFilename(filename);
|
s->setDefaultFilename(filename);
|
||||||
s.setDefaultFileBehavior(LOCAL_DEFAULT_FILE);
|
s->setDefaultFileBehavior(LOCAL_DEFAULT_FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
openLocalThenRemote(filename);
|
openLocalThenRemote(filename);
|
||||||
|
@ -1121,9 +1121,9 @@ void QMLManager::saveChangesLocal()
|
||||||
if (git_create_local_repo(filename))
|
if (git_create_local_repo(filename))
|
||||||
appendTextToLog(get_error_string());
|
appendTextToLog(get_error_string());
|
||||||
set_filename(filename);
|
set_filename(filename);
|
||||||
GeneralSettingsObjectWrapper s(this);
|
auto s = SettingsObjectWrapper::instance()->general_settings;
|
||||||
s.setDefaultFilename(filename);
|
s->setDefaultFilename(filename);
|
||||||
s.setDefaultFileBehavior(LOCAL_DEFAULT_FILE);
|
s->setDefaultFileBehavior(LOCAL_DEFAULT_FILE);
|
||||||
}
|
}
|
||||||
} else if (!loadFromCloud()) {
|
} else if (!loadFromCloud()) {
|
||||||
// this seems silly, but you need a common ancestor in the repository in
|
// this seems silly, but you need a common ancestor in the repository in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue