mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: remove dive_site member from merge_result
All callers were just using that member to set the dive_site in the resulting dive. We might just do that in the called function [merge_dives()]. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
5b46d8cc33
commit
27a89b0232
3 changed files with 6 additions and 10 deletions
|
@ -922,7 +922,7 @@ MergeDives::MergeDives(const QVector <dive *> &dives)
|
|||
return;
|
||||
}
|
||||
|
||||
auto [d, trip, site] = divelog.dives.merge_dives(*dives[0], *dives[1], dives[1]->when - dives[0]->when, false);
|
||||
auto [d, trip] = divelog.dives.merge_dives(*dives[0], *dives[1], dives[1]->when - dives[0]->when, false);
|
||||
|
||||
// Currently, the core code selects the dive -> this is not what we want, as
|
||||
// we manually manage the selection post-command.
|
||||
|
@ -932,11 +932,10 @@ MergeDives::MergeDives(const QVector <dive *> &dives)
|
|||
// Set the preferred dive trip, so that for subsequent merges the better trip can be selected
|
||||
d->divetrip = trip;
|
||||
for (int i = 2; i < dives.count(); ++i) {
|
||||
auto [d2, trip, site] = divelog.dives.merge_dives(*d, *dives[i], dives[i]->when - d->when, false);
|
||||
auto [d2, trip] = divelog.dives.merge_dives(*d, *dives[i], dives[i]->when - d->when, false);
|
||||
d = std::move(d2);
|
||||
// Set the preferred dive trip and site, so that for subsequent merges the better trip and site can be selected
|
||||
d->divetrip = trip;
|
||||
d->dive_site = site;
|
||||
}
|
||||
|
||||
// The merged dive gets the number of the first dive with a non-zero number
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue