mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: turn dive-trip location and notes into std::string
Simpler memory management. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2fd226964c
commit
3ee41328f9
29 changed files with 157 additions and 179 deletions
|
@ -1752,7 +1752,7 @@ static void merge_temperatures(struct dive *res, const struct dive *a, const str
|
|||
*/
|
||||
static struct dive_trip *get_preferred_trip(const struct dive *a, const struct dive *b)
|
||||
{
|
||||
dive_trip_t *atrip, *btrip;
|
||||
dive_trip *atrip, *btrip;
|
||||
|
||||
/* If only one dive has a trip, choose that */
|
||||
atrip = a->divetrip;
|
||||
|
@ -1769,13 +1769,13 @@ static struct dive_trip *get_preferred_trip(const struct dive *a, const struct d
|
|||
return atrip;
|
||||
|
||||
/* Otherwise, look at the trip data and pick the "better" one */
|
||||
if (!atrip->location)
|
||||
if (atrip->location.empty())
|
||||
return btrip;
|
||||
if (!btrip->location)
|
||||
if (btrip->location.empty())
|
||||
return atrip;
|
||||
if (!atrip->notes)
|
||||
if (atrip->notes.empty())
|
||||
return btrip;
|
||||
if (!btrip->notes)
|
||||
if (btrip->notes.empty())
|
||||
return atrip;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue