mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move get_dive_location()/_country() to struct dive
Feels natural in a C++ code base. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
f1f082d86a
commit
76d672210d
9 changed files with 18 additions and 21 deletions
|
@ -2496,16 +2496,14 @@ depth_t dive::gas_mnd(struct gasmix mix, depth_t end, int roundto) const
|
|||
return depth_t { (int)lrint(((double)mbar_to_depth(maxambient)) / roundto) * roundto };
|
||||
}
|
||||
|
||||
std::string get_dive_country(const struct dive *dive)
|
||||
std::string dive::get_country() const
|
||||
{
|
||||
struct dive_site *ds = dive->dive_site;
|
||||
return ds ? taxonomy_get_country(ds->taxonomy) : std::string();
|
||||
return dive_site ? taxonomy_get_country(dive_site->taxonomy) : std::string();
|
||||
}
|
||||
|
||||
std::string get_dive_location(const struct dive *dive)
|
||||
std::string dive::get_location() const
|
||||
{
|
||||
const struct dive_site *ds = dive->dive_site;
|
||||
return ds ? ds->name : std::string();
|
||||
return dive_site ? dive_site->name : std::string();
|
||||
}
|
||||
|
||||
int dive::number_of_computers() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue