From 837ab6c90b7952095c0dadf2de18db883b0f5ecf Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 29 Mar 2019 18:29:08 +0100 Subject: Desktop: read tab-items from current_dive, not displayed_dive The whole edit logic moved from displayed_dive to current_dive and it became more and more tedious to keep these in sync. Therefore, simply always display current_dive. The only exceptions are the equipment tab and the planner, as these are not yet integrated in the undo system. Once this is done, displayed_dive can be removed. Moreover, remove the clear parameter from updateDiveInfo(). Instead simply clear of there is no current_dive set. Signed-off-by: Berthold Stoeger --- desktop-widgets/mainwindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'desktop-widgets/mainwindow.cpp') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 0e4daf0e2..cc1adc3b2 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -465,7 +465,7 @@ void MainWindow::selectionChanged() { if (!current_dive) { mainTab->clearTabs(); - mainTab->updateDiveInfo(true); + mainTab->updateDiveInfo(); graphics->setEmptyState(); } else { graphics->plotDive(nullptr, false, true); @@ -634,8 +634,9 @@ void MainWindow::on_actionCloudOnline_triggered() void MainWindow::cleanUpEmpty() { + current_dive = nullptr; mainTab->clearTabs(); - mainTab->updateDiveInfo(true); + mainTab->updateDiveInfo(); graphics->setEmptyState(); diveList->reload(); diveList->setSortOrder(DiveTripModelBase::NR, Qt::DescendingOrder); -- cgit v1.2.3-70-g09d2