summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelistview.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-17 14:37:10 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-17 14:41:12 -0800
commit7a6ff7a53cc23c2129fb5f4d4046acf71404b087 (patch)
tree77279188aad8994332ed72e808322254c8a0459d /qt-ui/divelistview.cpp
parent962abba1f7f09f5d5b87e952e442589c0fced64b (diff)
downloadsubsurface-7a6ff7a53cc23c2129fb5f4d4046acf71404b087.tar.gz
Fix a couple of problems with dive merging
- Dive list no longer has messed up trip entries - Dive list is now correctly marked as modified after trips are merged - When data file is closed, the list of selected trips is cleared which avoids a potential crash when loading a new data file Fixes #286 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r--qt-ui/divelistview.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index 9779d60e7..b0045b765 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -437,7 +437,11 @@ void DiveListView::merge_trip(const QModelIndex &a, int offset)
trip_a->notes = strdup(trip_b->notes);
while (trip_b->dives)
add_dive_to_trip(trip_b->dives, trip_a);
+ rememberSelection();
reload(currentLayout, false);
+ fixMessyQtModelBehaviour();
+ restoreSelection();
+ mark_divelist_changed(TRUE);
}
void DiveListView::mergeTripAbove()