diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-05-29 16:50:25 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-05-29 16:50:25 -0300 |
commit | 94c3545c180f05db50eb223c658a3534a8dcfa0d (patch) | |
tree | 4a9578964582db53a3ca50447d06bc62dae24630 | |
parent | 16d0a47853db6b3957805443cb7f4dd520c7af78 (diff) | |
download | subsurface-94c3545c180f05db50eb223c658a3534a8dcfa0d.tar.gz |
Code Cleanup.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
-rw-r--r-- | qt-ui/divelistview.cpp | 7 |
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); |