mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Mark divelist as changed even if imported dives got merged
The number of dives didn't go up, but we have one (or more) additional dive computers added to an existing dive. Fixes #936 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
cb112f9ac5
commit
c378df81ab
1 changed files with 7 additions and 2 deletions
|
@ -1026,6 +1026,7 @@ void process_dives(bool is_imported, bool prefer_imported)
|
|||
{
|
||||
int i;
|
||||
int preexisting = dive_table.preexisting;
|
||||
bool did_merge = false;
|
||||
struct dive *last;
|
||||
|
||||
/* check if we need a nickname for the divecomputer for newly downloaded dives;
|
||||
|
@ -1077,6 +1078,9 @@ void process_dives(bool is_imported, bool prefer_imported)
|
|||
delete_single_dive(i + 1);
|
||||
// keep the id or the first dive for the merged dive
|
||||
merged->id = id;
|
||||
|
||||
/* this means the table was changed */
|
||||
did_merge = true;
|
||||
}
|
||||
/* make sure no dives are still marked as downloaded */
|
||||
for (i = 1; i < dive_table.nr; i++)
|
||||
|
@ -1087,11 +1091,12 @@ void process_dives(bool is_imported, bool prefer_imported)
|
|||
if (!last || last->number)
|
||||
try_to_renumber(last, preexisting);
|
||||
|
||||
/* did we add dives to the dive table? */
|
||||
if (preexisting != dive_table.nr)
|
||||
/* did we add dives or divecomputers to the dive table? */
|
||||
if (did_merge || preexisting < dive_table.nr) {
|
||||
mark_divelist_changed(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void set_dive_nr_for_current_dive()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue