mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move get_distance() from divesite.cpp to units.cpp
This gives the distance between to location_t objects. It is unclear why this was in divesite.cpp. Moreover pass by value, not raw pointer. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2de6f69c19
commit
7d7766be9a
9 changed files with 30 additions and 30 deletions
|
@ -390,7 +390,7 @@ bool DiveLocationFilterProxyModel::lessThan(const QModelIndex &source_left, cons
|
|||
// The dive sites are -2 because of the first two items.
|
||||
auto loc1 = (*divelog.sites)[source_left.row() - 2]->location;
|
||||
auto loc2 = (*divelog.sites)[source_right.row() - 2]->location;
|
||||
return get_distance(&loc1, ¤tLocation) < get_distance(&loc2, ¤tLocation);
|
||||
return get_distance(loc1, currentLocation) < get_distance(loc2, currentLocation);
|
||||
}
|
||||
return source_left.data().toString().compare(source_right.data().toString(), Qt::CaseInsensitive) < 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue