summaryrefslogtreecommitdiffstats
path: root/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-04 15:50:14 +1100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-04 15:50:14 +1100
commit91ba78f8ac40f02d7161e5f82644557279f3c92b (patch)
treeb38a9366a3d4e4adf6eabc224059fa941aa627a5 /uemis-downloader.c
parentdb05dd78f3cadaea32e260f68ad50e1c0da21526 (diff)
downloadsubsurface-91ba78f8ac40f02d7161e5f82644557279f3c92b.tar.gz
Fix minor translation tool issue in Uemis downloader
If any component of the suit information downloaded from the Uemis SDA is "" we would replace that by the POT information when running the software in a different locale. So only add this text (and translate this text) if it is != "". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r--uemis-downloader.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c
index 065237971..c20ebb838 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -594,26 +594,30 @@ static void parse_tag(struct dive *dive, char *tag, char *val)
{
/* we can ignore computer_id, water and gas as those are redundant
* with the binary data and would just get overwritten */
- if (! strcmp(tag, "date"))
+ if (! strcmp(tag, "date")) {
uemis_ts(val, &dive->when);
- else if (!strcmp(tag, "duration"))
+ } else if (!strcmp(tag, "duration")) {
uemis_duration(val, &dive->dc.duration);
- else if (!strcmp(tag, "depth"))
+ } else if (!strcmp(tag, "depth")) {
uemis_depth(val, &dive->dc.maxdepth);
- else if (!strcmp(tag, "file_content"))
+ } else if (!strcmp(tag, "file_content")) {
uemis_parse_divelog_binary(val, dive);
- else if (!strcmp(tag, "altitude"))
+ } else if (!strcmp(tag, "altitude")) {
uemis_get_index(val, &dive->dc.surface_pressure.mbar);
- else if (!strcmp(tag, "f32Weight"))
+ } else if (!strcmp(tag, "f32Weight")) {
uemis_get_weight(val, &dive->weightsystem[0], dive->dc.diveid);
- else if (!strcmp(tag, "notes"))
+ } else if (!strcmp(tag, "notes")) {
uemis_add_string(val, &dive->notes);
- else if (!strcmp(tag, "u8DiveSuit"))
- uemis_add_string(_(suit[atoi(val)]), &dive->suit);
- else if (!strcmp(tag, "u8DiveSuitType"))
- uemis_add_string(_(suit_type[atoi(val)]), &dive->suit);
- else if (!strcmp(tag, "u8SuitThickness"))
- uemis_add_string(_(suit_thickness[atoi(val)]), &dive->suit);
+ } else if (!strcmp(tag, "u8DiveSuit")) {
+ if (*suit[atoi(val)])
+ uemis_add_string(_(suit[atoi(val)]), &dive->suit);
+ } else if (!strcmp(tag, "u8DiveSuitType")) {
+ if (*suit_type[atoi(val)])
+ uemis_add_string(_(suit_type[atoi(val)]), &dive->suit);
+ } else if (!strcmp(tag, "u8SuitThickness")) {
+ if (*suit_thickness[atoi(val)])
+ uemis_add_string(_(suit_thickness[atoi(val)]), &dive->suit);
+ }
}
/* This function is called for both divelog and dive information that we get