mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Start merging dives by keeping the dive computer data from both dives
Also, note that we do *not* do the "find_sample_offset()" any more when we merge two dives that happen at the same time - since we just keep both sets of dive computer data around. But we keep the function to find the best offset around, because we may well want to use it later when *showing* the dive, and trying to match up the different sample data from the multiple dive computers associated with the dive. Because of that, this causes warnings about the now unused function. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5a4640cf44
commit
1b861ba20e
2 changed files with 129 additions and 24 deletions
22
save-xml.c
22
save-xml.c
|
@ -349,23 +349,19 @@ static void save_trip(FILE *f, dive_trip_t *trip)
|
|||
static void save_dc(FILE *f, struct dive *dive, struct divecomputer *dc)
|
||||
{
|
||||
int i;
|
||||
const char *post = "";
|
||||
|
||||
if (dc->when || dc->vendor || dc->product) {
|
||||
fprintf(f, "<divecomputer");
|
||||
if (dc->vendor)
|
||||
show_utf8(f, dc->vendor, " vendor='", "'", 1);
|
||||
if (dc->product)
|
||||
show_utf8(f, dc->product, " product='", "'", 1);
|
||||
if (dc->when && dc->when != dive->when)
|
||||
show_date(f, dc->when);
|
||||
fprintf(f, ">\n");
|
||||
post = "</divecomputer>\n";
|
||||
}
|
||||
fprintf(f, " <divecomputer");
|
||||
if (dc->vendor)
|
||||
show_utf8(f, dc->vendor, " vendor='", "'", 1);
|
||||
if (dc->product)
|
||||
show_utf8(f, dc->product, " product='", "'", 1);
|
||||
if (dc->when && dc->when != dive->when)
|
||||
show_date(f, dc->when);
|
||||
fprintf(f, ">\n");
|
||||
save_events(f, dc->events);
|
||||
for (i = 0; i < dc->samples; i++)
|
||||
save_sample(f, dc->sample+i);
|
||||
fprintf(f, post);
|
||||
fprintf(f, " </divecomputer>\n");
|
||||
}
|
||||
|
||||
static void save_dive(FILE *f, struct dive *dive)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue