summaryrefslogtreecommitdiffstats
path: root/webservice.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-03-02 14:00:10 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-03-02 14:00:10 -0800
commit0ddc77ed9de0e1ee5cbff21771678db8be67d205 (patch)
treee2458aa8b2ba5102c66d660163bec37d93d49db9 /webservice.c
parentd85b4e64623a3c5e95fe3fe27d5313bf16392af5 (diff)
downloadsubsurface-0ddc77ed9de0e1ee5cbff21771678db8be67d205.tar.gz
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 <dirk@hohndel.org>
Diffstat (limited to 'webservice.c')
-rw-r--r--webservice.c14
1 files 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
}
}
}