mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
desktop: fold DiveListView::selectDive into DiveListView::selectDive
DiveListView::selectDive() is an overloaded function. The second version was only called by the first version, so we can fold one into the other. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
f8d3501c22
commit
9fae262188
2 changed files with 8 additions and 15 deletions
|
@ -306,19 +306,6 @@ QList<dive_trip_t *> DiveListView::selectedTrips()
|
||||||
return ret;
|
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)
|
void DiveListView::selectDive(int i)
|
||||||
{
|
{
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
|
@ -328,7 +315,14 @@ void DiveListView::selectDive(int i)
|
||||||
if (match.isEmpty())
|
if (match.isEmpty())
|
||||||
return;
|
return;
|
||||||
QModelIndex idx = match.first();
|
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)
|
void DiveListView::selectDives(const QList<int> &newDiveSelection)
|
||||||
|
|
|
@ -86,7 +86,6 @@ private:
|
||||||
void addToTrip(int delta);
|
void addToTrip(int delta);
|
||||||
void matchImagesToDives(QStringList fileNames);
|
void matchImagesToDives(QStringList fileNames);
|
||||||
void loadImageFromURL(QUrl url);
|
void loadImageFromURL(QUrl url);
|
||||||
void selectDive(QModelIndex index);
|
|
||||||
void selectDive(int dive_table_idx);
|
void selectDive(int dive_table_idx);
|
||||||
QNetworkAccessManager manager;
|
QNetworkAccessManager manager;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue