From a8fbd3d283d8fe48b9e9658d81bbaee2a25b5a69 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 14 May 2014 15:30:07 +0900 Subject: 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 Signed-off-by: Dirk Hohndel --- divelist.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'divelist.c') 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); -- cgit v1.2.3-70-g09d2