mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: avoid spurious updateDiveInfo() calls
In 2e230da361
the dive-selection signals
were unified. Sadly, this was done in a suboptimal way resulting in
numerous calls to updateDiveInfo(), which refreshes the main-tab.
Firstly, the MainWindow connected to selection changes from both,
the undo-command and the divelist. Secondly, every selected dive
in the divelist caused a single signal.
Thus, connect only to the divelist (this is necessary for user-initiated
selection changes) and only send a single signal in the divelist
per selection-reset.
This is still less than perfect as updateDiveInfo() is called even
if the current dive doesn't change.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
5c1446a87a
commit
57c22d3dcc
2 changed files with 7 additions and 1 deletions
|
@ -191,7 +191,6 @@ MainWindow::MainWindow() : QMainWindow(),
|
|||
if (!QIcon::hasThemeIcon("window-close")) {
|
||||
QIcon::setThemeName("subsurface");
|
||||
}
|
||||
connect(&diveListNotifier, &DiveListNotifier::divesSelected, this, &MainWindow::selectionChanged);
|
||||
connect(diveList, &DiveListView::divesSelected, this, &MainWindow::selectionChanged);
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(readSettings()));
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), diveList, SLOT(update()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue