diff options
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r-- | qt-ui/divelistview.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index 4b856f601..2e40678ad 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -226,16 +226,7 @@ void DiveListView::currentChanged(const QModelIndex& current, const QModelIndex& { if (!current.isValid()) return; - const QAbstractItemModel *model = current.model(); - int selectedDive = 0; - struct dive *dive = (struct dive*) model->data(current, DiveTripModel::DIVE_ROLE).value<void*>(); - if (!dive) // it's a trip! select first child. - dive = (struct dive*) model->data(current.child(0,0), DiveTripModel::DIVE_ROLE).value<void*>(); - selectedDive = get_divenr(dive); scrollTo(current); - if (selectedDive == selected_dive) - return; - Q_EMIT currentDiveChanged(selectedDive); } void DiveListView::selectionChanged(const QItemSelection& selected, const QItemSelection& deselected) |