diff options
-rw-r--r-- | desktop-widgets/divelistview.cpp | 22 | ||||
-rw-r--r-- | desktop-widgets/divelistview.h | 1 |
2 files changed, 8 insertions, 15 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index b3988c8ff..bce8b2eb3 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -306,19 +306,6 @@ QList<dive_trip_t *> DiveListView::selectedTrips() return ret; } -void DiveListView::selectDive(QModelIndex idx) -{ - if (!idx.isValid()) - return; - selectionModel()->setCurrentIndex(idx, QItemSelectionModel::Select | QItemSelectionModel::Rows); - if (idx.parent().isValid()) { - setAnimated(false); - expand(idx.parent()); - setAnimated(true); - } - selectionChangeDone(); -} - void DiveListView::selectDive(int i) { if (i == -1) @@ -328,7 +315,14 @@ void DiveListView::selectDive(int i) if (match.isEmpty()) return; QModelIndex idx = match.first(); - selectDive(idx); + + selectionModel()->setCurrentIndex(idx, QItemSelectionModel::Select | QItemSelectionModel::Rows); + if (idx.parent().isValid()) { + setAnimated(false); + expand(idx.parent()); + setAnimated(true); + } + selectionChangeDone(); } void DiveListView::selectDives(const QList<int> &newDiveSelection) diff --git a/desktop-widgets/divelistview.h b/desktop-widgets/divelistview.h index f372edc46..ffaf6c78f 100644 --- a/desktop-widgets/divelistview.h +++ b/desktop-widgets/divelistview.h @@ -86,7 +86,6 @@ private: void addToTrip(int delta); void matchImagesToDives(QStringList fileNames); void loadImageFromURL(QUrl url); - void selectDive(QModelIndex index); void selectDive(int dive_table_idx); QNetworkAccessManager manager; }; |