summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2016-05-27 22:50:58 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-05-28 14:22:58 -0700
commit1aa6bd9904f48ab08cf39dff66d81839f17b9f75 (patch)
tree85fc8f3694e83f8fd8de111eb7a11ebcc5a609a7 /core
parent1e5fe4f3fe24adf483425654ac9eeb1327747a96 (diff)
downloadsubsurface-1aa6bd9904f48ab08cf39dff66d81839f17b9f75.tar.gz
Set model on Shearwater import
For starters, let's just state that this dive was downloaded from Shearwater. However, once we have information how model numbers map to names, we can use that info for the models we know about. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r--core/parse-xml.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/core/parse-xml.c b/core/parse-xml.c
index 5eccbb9a7..e22881b0f 100644
--- a/core/parse-xml.c
+++ b/core/parse-xml.c
@@ -2721,14 +2721,27 @@ extern int shearwater_dive(void *param, int columns, char **data, char **column)
dc_settings_start();
if (data[9])
utf8_string(data[9], &cur_settings.dc.serial_nr);
- if (data[10])
- utf8_string(data[10], &cur_settings.dc.model);
+ if (data[10]) {
+ switch (atoi(data[10])) {
+ default:
+ cur_settings.dc.model = strdup("Shearwater import");
+ break;
+ }
+ }
cur_settings.dc.deviceid = atoi(data[9]);
dc_settings_end();
settings_end();
+ if (data[10]) {
+ switch (atoi(data[10])) {
+ default:
+ cur_dive->dc.model = strdup("Shearwater import");
+ break;
+ }
+ }
+
snprintf(get_buffer, sizeof(get_buffer) - 1, get_cylinder_template, cur_dive->number);
retval = sqlite3_exec(handle, get_buffer, &shearwater_cylinders, 0, &err);
if (retval != SQLITE_OK) {