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 <[email protected]>
---
 core/parse-xml.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/core/parse-xml.c b/core/parse-xml.c
index 5eccbb9..e22881b 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) {
-- 
2.5.0

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to