desktop: fix editing of trips

In 2021035cfc 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>
This commit is contained in:
Berthold Stoeger 2020-05-02 14:02:53 +02:00 committed by bstoeger
parent e535ac90f9
commit a8130f0fa1

View file

@ -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();