diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-05-02 14:02:53 +0200 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2020-05-02 14:52:51 +0200 |
commit | a8130f0fa16a35dd647d04449c8e561156e86549 (patch) | |
tree | 5bbdb57d4ac612457011ad4e790048a882e3bfea /desktop-widgets/tab-widgets | |
parent | e535ac90f944a568bf1d96571774be702345a8e2 (diff) | |
download | subsurface-a8130f0fa16a35dd647d04449c8e561156e86549.tar.gz |
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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(); |