summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r--qt-ui/divelistview.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index 46daa0f12..e92cb2d1f 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -148,12 +148,9 @@ void DiveListView::currentChanged(const QModelIndex& current, const QModelIndex&
const QAbstractItemModel *model = current.model();
int selectedDive = 0;
struct dive *dive = (struct dive*) model->data(current, TreeItemDT::DIVE_ROLE).value<void*>();
- if (!dive) { // it's a trip! select first child.
+ if (!dive) // it's a trip! select first child.
dive = (struct dive*) model->data(current.child(0,0), TreeItemDT::DIVE_ROLE).value<void*>();
- selectedDive = get_divenr(dive);
- } else {
- selectedDive = get_divenr(dive);
- }
+ selectedDive = get_divenr(dive);
if (selectedDive == selected_dive)
return;
Q_EMIT currentDiveChanged(selectedDive);