diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-06-06 11:22:08 +0900 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-06-06 11:28:20 +0900 |
commit | 6f7e13ac70499ccc74ecf9d03aea65883f530b5c (patch) | |
tree | 2145fc1337f83a033f6ffcc66a8bd45354bff787 /qt-ui/mainwindow.cpp | |
parent | 3f7490c2053090bfd54de2fcb4df23c5be7b5ffd (diff) | |
download | subsurface-6f7e13ac70499ccc74ecf9d03aea65883f530b5c.tar.gz |
Try to get rid of unnecessary reloads of the dive list
Don't call refreshDisplay() after preferences change. This strangely
somehow leads to a situation where I need to move the mouse over the dive
list before changes to the units are reflected.
When calling reload() do not force layout change / resort unless that is
the intention.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 3c550439b..f3dbf2889 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -42,11 +42,11 @@ MainWindow::MainWindow() : ui(new Ui::MainWindow()), helpView(0) setWindowIcon(QIcon(":subsurface-icon")); connect(ui->ListWidget, SIGNAL(currentDiveChanged(int)), this, SLOT(current_dive_changed(int))); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(readSettings())); - connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(refreshDisplay())); + connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui->ListWidget, SLOT(update())); connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui->ProfileWidget, SLOT(refresh())); ui->mainErrorMessage->hide(); ui->ProfileWidget->setFocusProxy(ui->ListWidget); - ui->ListWidget->reload(); + ui->ListWidget->reload(DiveTripModel::TREE); initialUiSetup(); readSettings(); ui->ListWidget->reloadHeaderActions(); @@ -60,7 +60,7 @@ void MainWindow::refreshDisplay() { if (selected_dive == -1) current_dive_changed(dive_table.nr - 1); - ui->ListWidget->reload(); + ui->ListWidget->reload(DiveTripModel::CURRENT, false); } void MainWindow::current_dive_changed(int divenr) @@ -106,7 +106,7 @@ void MainWindow::on_actionOpen_triggered() ui->InfoWidget->reload(); ui->globe->reload(); - ui->ListWidget->reload(); + ui->ListWidget->reload(DiveTripModel::TREE); ui->ListWidget->setFocus(); } @@ -139,7 +139,7 @@ void MainWindow::on_actionClose_triggered() ui->InfoWidget->clearEquipment(); ui->InfoWidget->updateDiveInfo(-1); ui->ProfileWidget->clear(); - ui->ListWidget->reload(); + ui->ListWidget->reload(DiveTripModel::TREE); ui->globe->reload(); clear_events(); |