From 10ce60e2120419282ff7694e8deda60e94832aa1 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 21 Nov 2012 15:34:04 -0800 Subject: Fix "prefer download" behavior When this was first implemented the assumption was that a downloaded dive that is to be merged with an existing dive would have the same time stamp. But as Linus pointed out even back then, this does fail if a dive has been merged with a download from a different dive computer before (think: download from computer a, then download same dive from b, then improve something in the parsing from computer a and try to redownload; the time stamp could have changed). This commit also fixes a silly omission in the merge_dives() function (which ended up ALWAYS prefering the downloaded dive) and finally implements the necessary changes to mark dives downloaded from a Uemis SDA as well. Signed-off-by: Dirk Hohndel --- file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index db72b5f66..31f5d882c 100644 --- a/file.c +++ b/file.c @@ -72,7 +72,7 @@ static void suunto_read(struct zip_file *file, GError **error) size = read * 3 / 2; mem = realloc(mem, size); } - parse_xml_buffer(_("SDE file"), mem, read, error); + parse_xml_buffer(_("SDE file"), mem, read, FALSE, error); free(mem); } #endif @@ -246,7 +246,7 @@ static void parse_file_buffer(const char *filename, struct memblock *mem, GError if (fmt && open_by_filename(filename, fmt+1, mem, error)) return; - parse_xml_buffer(filename, mem->buffer, mem->size, error); + parse_xml_buffer(filename, mem->buffer, mem->size, FALSE, error); } void parse_file(const char *filename, GError **error, gboolean possible_default_filename) -- cgit v1.2.3-70-g09d2