diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2015-07-12 23:16:59 +0530 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-12 13:58:17 -0700 |
commit | c91ee860f2dff268182d80bb8f64b0ea5109c58b (patch) | |
tree | a9681ec1e36e3d5104665894f403e687836a700f /parse-xml.c | |
parent | a52fc86a1c4590cdebe3f6f14949b7418bf1bee2 (diff) | |
download | subsurface-c91ee860f2dff268182d80bb8f64b0ea5109c58b.tar.gz |
Divinglog import: use dive ID as identifier
Since mapping cylinders requires use of dive ID, we might as well use
the ID to map the profile also.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r-- | parse-xml.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/parse-xml.c b/parse-xml.c index 97e378571..bca7345cc 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -2985,7 +2985,7 @@ extern int divinglog_dive(void *param, int columns, char **data, char **column) int retval = 0, diveid; sqlite3 *handle = (sqlite3 *)param; char *err = NULL; - char get_profile_template[] = "select ProfileInt,Profile,Profile2 from Logbook where Number = %d"; + char get_profile_template[] = "select ProfileInt,Profile,Profile2 from Logbook where ID = %d"; char get_cylinder_template[] = "select TankID,TankSize,PresS,PresE,PresW,O2,He,DblTank from Tank where LogID = %d order by TankID"; char get_buffer[1024]; @@ -3053,13 +3053,7 @@ extern int divinglog_dive(void *param, int columns, char **data, char **column) cur_dive->dc.model = strdup("Divinglog import"); } - /* - * Parse Profile - depth and warnings - * I am assuming that dive number is unique, but if not, then we - * will have to use ID instead. - */ - - snprintf(get_buffer, sizeof(get_buffer) - 1, get_profile_template, cur_dive->number); + snprintf(get_buffer, sizeof(get_buffer) - 1, get_profile_template, diveid); retval = sqlite3_exec(handle, get_buffer, &divinglog_profile, 0, &err); if (retval != SQLITE_OK) { fprintf(stderr, "%s", "Database query divinglog_profile failed.\n"); |