summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2014-05-14 15:30:07 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-14 15:39:29 +0900
commita8fbd3d283d8fe48b9e9658d81bbaee2a25b5a69 (patch)
tree2264a72482b401cbd5f39719486e5b1900a719ae /divelist.c
parent818542eeca6da96b0f10b3dda70d14cdd80399ea (diff)
downloadsubsurface-a8fbd3d283d8fe48b9e9658d81bbaee2a25b5a69.tar.gz
Mark new dives "downloaded" when importing new dives
We used to do this just for dive computer downloads, but we should do it for all imports, so that merging new import data always does the expected thing: any new dive computers will be added to the end of the list of preexisting dives, rather than the other way around. (Of course, if you set the "prefer downloaded" flag, that reverses this logic, and makes the newly imported dive computer data be the primary dive computer. That flag is currently only exported for dive computer downloads, not for imports). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/divelist.c b/divelist.c
index b19971087..513b9265e 100644
--- a/divelist.c
+++ b/divelist.c
@@ -912,6 +912,9 @@ void process_dives(bool is_imported, bool prefer_imported)
for (i = preexisting; i < dive_table.nr; i++)
set_dc_nickname(dive_table.dives[i]);
+ for (i = preexisting; i < dive_table.nr; i++)
+ dive_table.dives[i]->downloaded = true;
+
/* This does the right thing for -1: NULL */
last = get_dive(preexisting - 1);