mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
map: use value semantics for MapLocation
This makes memory management more simple, as not explicit deletion is necessary. A rather large commit, because changing QVector<> to std::vector<> is propagated up the call chain. Adds a new range_contains() helper function for collection types such as std::vector<>. I didn't want to call it contains(), since we already have a contains function for strings and let's keep argument overloading simple. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
e39dea3d68
commit
6b835710bc
17 changed files with 84 additions and 75 deletions
|
@ -115,14 +115,14 @@ void DiveSiteListView::on_filterText_textChanged(const QString &text)
|
|||
model->setFilter(text);
|
||||
}
|
||||
|
||||
QVector<dive_site *> DiveSiteListView::selectedDiveSites()
|
||||
std::vector<dive_site *> DiveSiteListView::selectedDiveSites()
|
||||
{
|
||||
const QModelIndexList indices = ui.diveSites->view()->selectionModel()->selectedRows();
|
||||
QVector<dive_site *> sites;
|
||||
std::vector<dive_site *> sites;
|
||||
sites.reserve(indices.size());
|
||||
for (const QModelIndex &idx: indices) {
|
||||
struct dive_site *ds = model->getDiveSite(idx);
|
||||
sites.append(ds);
|
||||
sites.push_back(ds);
|
||||
}
|
||||
return sites;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue