From 0ddc77ed9de0e1ee5cbff21771678db8be67d205 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 2 Mar 2013 14:00:10 -0800 Subject: [PATCH] Recognize another name for auto created fixes from companion app We need to have this be one well defined string -> this requires a change to the companion app as well. This commit also hides the (untranslated) debug message if no dives in the dive table match a gpsfix downloaded from the webservice. Signed-off-by: Dirk Hohndel --- webservice.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/webservice.c b/webservice.c index 5308046f0..2c8eea80e 100644 --- a/webservice.c +++ b/webservice.c @@ -169,8 +169,8 @@ static void download_dialog_response_cb(GtkDialog *d, gint response, gpointer da static gboolean is_automatic_fix(struct dive *gpsfix) { if (gpsfix && gpsfix->location && - !strcmp(gpsfix->location, "automatic fix") && - !strcmp(gpsfix->location, "Auto-created dive")) + (!strcmp(gpsfix->location, "automatic fix") || + !strcmp(gpsfix->location, "Auto-created dive"))) return TRUE; return FALSE; } @@ -189,6 +189,14 @@ static gboolean merge_locations_into_dives(void) if (is_automatic_fix(gpsfix)) { dive = find_dive_including(gpsfix->when); if (dive && !dive_has_gps_location(dive)) { +#if DEBUG_WEBSERVICE + struct tm tm; + utc_mkdate(gpsfix->when, &tm); + printf("found dive named %s @ %04d-%02d-%02d %02d:%02d:%02d\n", + gpsfix->location, + tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec); +#endif changed++; copy_gps_location(gpsfix, dive); } @@ -212,10 +220,12 @@ static gboolean merge_locations_into_dives(void) } else { struct tm tm; utc_mkdate(gpsfix->when, &tm); +#if DEBUG_WEBSERVICE printf("didn't find dive matching gps fix named %s @ %04d-%02d-%02d %02d:%02d:%02d\n", gpsfix->location, tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); +#endif } } }