From a8130f0fa16a35dd647d04449c8e561156e86549 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 2 May 2020 14:02:53 +0200 Subject: desktop: fix editing of trips In 2021035cfcee08ec4c6f9d16683db8ce400bef30 a bug was introduced: currentTrip of MainTab was not set in trip mode. Thus, when editing the trip notes, the notes of all selected dives were edited instead. Set the member variable and not a local variable. Signed-off-by: Berthold Stoeger --- desktop-widgets/tab-widgets/maintab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'desktop-widgets/tab-widgets/maintab.cpp') diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index ab8b5fbf3..bf277d74d 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -365,7 +365,7 @@ void MainTab::updateDiveInfo() // 2) the filter is reset, potentially erasing the current trip under our feet. // TODO: Don't hard code tab location! bool onDiveSiteTab = ui.tabWidget->currentIndex() == 6; - if (dive_trip *currentTrip = MainWindow::instance()->diveList->singleSelectedTrip()) { + if ((currentTrip = MainWindow::instance()->diveList->singleSelectedTrip()) != nullptr) { // Remember the tab selected for last dive but only if we're not on the dive site tab if (lastSelectedDive && !onDiveSiteTab) lastTabSelectedDive = ui.tabWidget->currentIndex(); -- cgit v1.2.3-70-g09d2