mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Import: remove dive->downloaded logic
Dive importing is now performed via a distinct table which is merged into the main dive table. Thus, it is known which of the dive is new and which is old. This information can now be implicitely encoded in the parameter-position of merge_dive() [i.e. pass old as first and new as second dive]. This makes marking of downloaded dives via a flag unnecessary. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
ab14889563
commit
e5dca8228e
2 changed files with 21 additions and 36 deletions
|
@ -1367,9 +1367,6 @@ void process_imported_dives(struct dive_table *import_table, bool prefer_importe
|
|||
sort_table(import_table);
|
||||
merge_imported_dives(import_table);
|
||||
|
||||
for (i = 0; i < import_table->nr; i++)
|
||||
import_table->dives[i]->downloaded = true;
|
||||
|
||||
/* Merge newly imported dives into the dive table.
|
||||
* Since both lists (old and new) are sorted, we can step
|
||||
* through them concurrently and locate the insertions points.
|
||||
|
@ -1416,10 +1413,6 @@ void process_imported_dives(struct dive_table *import_table, bool prefer_importe
|
|||
for ( ; i < import_table->nr; i++)
|
||||
add_single_dive(dive_table.nr, import_table->dives[i]);
|
||||
|
||||
/* make sure no dives are still marked as downloaded */
|
||||
for (i = 0; i < dive_table.nr; i++)
|
||||
dive_table.dives[i]->downloaded = false;
|
||||
|
||||
/* we took care of all dives, clean up the import table */
|
||||
import_table->nr = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue