mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Start to use the QSettings ObjectWrapper
start of the QSettinsg Object Wrapper usage on the code this first patch removes two macros that generated around 200 lines in runtime for something like a quarter of it Basically, whenever we changed anything we called the PreferencesDialog::settingsChanged and connected everythign to that signal, now each setting has it's own changed signal and we can call it directly. The best thing about this approach is that we don't trigger repaints for things that are not directly profile related. ( actually we still do, but the plan is to remove them in due time) this commit breaks correct atualization of the profile (because everything was connected to PreferencesDialog::settingsChanged) and now I need to hunt a bit for the correct connections Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5afda93b71
commit
2c5fad73e8
7 changed files with 91 additions and 89 deletions
|
@ -88,15 +88,6 @@ int main(int argc, char **argv)
|
|||
// in case something has gone wrong make sure we show the error message
|
||||
m->showError();
|
||||
|
||||
// now let's set up some connections
|
||||
QObject::connect(m->graphics(), &ProfileWidget2::enableToolbar ,m, &MainWindow::setEnabledToolbar, Qt::AutoConnection);
|
||||
QObject::connect(m->graphics(), &ProfileWidget2::showError, m, &MainWindow::showError, Qt::AutoConnection);
|
||||
QObject::connect(m->graphics(), &ProfileWidget2::disableShortcuts, m, &MainWindow::disableShortcuts, Qt::AutoConnection);
|
||||
QObject::connect(m->graphics(), &ProfileWidget2::enableShortcuts, m, &MainWindow::enableShortcuts, Qt::AutoConnection);
|
||||
QObject::connect(m->graphics(), &ProfileWidget2::refreshDisplay, m, &MainWindow::refreshDisplay, Qt::AutoConnection);
|
||||
QObject::connect(m->graphics(), &ProfileWidget2::updateDiveInfo, m->information(), &MainTab::updateDiveInfo, Qt::AutoConnection);
|
||||
QObject::connect(m->graphics(), &ProfileWidget2::editCurrentDive, m, &MainWindow::editCurrentDive, Qt::AutoConnection);
|
||||
QObject::connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), m->graphics(), SLOT(settingsChanged()));
|
||||
if (verbose > 0)
|
||||
print_files();
|
||||
if (!quit)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue