mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-17 21:46:17 +00:00
Map Divinglog's visibility to our stars
good (1) = 5 medium (2) = 3 bad (3) = 1 There seems also to be 0 used in the log, even though it is not mentioned in the valid selections. This is not giving any stars for this option... Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
parent
a7231be9a0
commit
685c59214d
1 changed files with 18 additions and 3 deletions
|
@ -3348,9 +3348,24 @@ extern int divinglog_dive(void *param, int columns, char **data, char **column)
|
|||
if (data[11])
|
||||
cur_dive->suit = strdup(data[11]);
|
||||
|
||||
/* TODO: check what the visibility options are in Divinglog and map them to Subsurface's 0-5 scale */
|
||||
if (data[14])
|
||||
cur_dive->visibility = atoi(data[14]);
|
||||
/* Divinglog has following visibility options: good, medium, bad */
|
||||
if (data[14]) {
|
||||
switch(data[14][0]) {
|
||||
case '0':
|
||||
break;
|
||||
case '1':
|
||||
cur_dive->visibility = 5;
|
||||
break;
|
||||
case '2':
|
||||
cur_dive->visibility = 3;
|
||||
break;
|
||||
case '3':
|
||||
cur_dive->visibility = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
settings_start();
|
||||
dc_settings_start();
|
||||
|
|
Loading…
Add table
Reference in a new issue