diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-11-24 14:10:53 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-12-12 15:52:40 -0800 |
commit | 712e4680cae91ca3ca7291bc7f5124d5a3578a4d (patch) | |
tree | 4cd87796f3532e8ab2028da4386496af21d1eb89 /desktop-widgets/preferences/preferencesdialog.cpp | |
parent | 0fab09a9901314f5597b16da370d3712ce28c4ae (diff) | |
download | subsurface-712e4680cae91ca3ca7291bc7f5124d5a3578a4d.tar.gz |
preferences: connect() dialog page only once
Weirdly, the settingsChanged() signal of the dialog-pages was
connected() to the settingsChanged() signal of the dialog
every time the settings were accepted. Do it only once
in the constructor.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/preferences/preferencesdialog.cpp')
-rw-r--r-- | desktop-widgets/preferences/preferencesdialog.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/desktop-widgets/preferences/preferencesdialog.cpp b/desktop-widgets/preferences/preferencesdialog.cpp index 6ad91acec..1164c5de3 100644 --- a/desktop-widgets/preferences/preferencesdialog.cpp +++ b/desktop-widgets/preferences/preferencesdialog.cpp @@ -84,6 +84,7 @@ PreferencesDialog::PreferencesDialog() pagesList->addItem(item); pagesStack->addWidget(page); page->refreshSettings(); + connect(page, &AbstractPreferencesWidget::settingsChanged, &diveListNotifier, &DiveListNotifier::settingsChanged); } connect(pagesList, &QListWidget::currentRowChanged, @@ -116,10 +117,8 @@ void PreferencesDialog::refreshPages() void PreferencesDialog::applyRequested(bool closeIt) { - Q_FOREACH(AbstractPreferencesWidget *page, pages) { - connect(page, &AbstractPreferencesWidget::settingsChanged, &diveListNotifier, &DiveListNotifier::settingsChanged, Qt::UniqueConnection); + for (AbstractPreferencesWidget *page: pages) page->syncSettings(); - } emit diveListNotifier.settingsChanged(); if (closeIt) accept(); |