mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
Don't print a total weight of 0 in the weight column
For consistency with the rest of the dive_list we should interpret "no weight systems recorded" as "no information" and therefore print nothing instead of printing a total weight of "0" for these dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
19621bf481
commit
3c542b5a41
1 changed files with 4 additions and 1 deletions
|
@ -294,7 +294,10 @@ static void weight_data_func(GtkTreeViewColumn *col,
|
|||
gtk_tree_model_get(model, iter, DIVE_INDEX, &indx, -1);
|
||||
dive = get_dive(indx);
|
||||
value = get_weight_units(total_weight(dive), &decimals, NULL);
|
||||
snprintf(buffer, sizeof(buffer), "%.*f", decimals, value);
|
||||
if (value == 0.0)
|
||||
*buffer = '\0';
|
||||
else
|
||||
snprintf(buffer, sizeof(buffer), "%.*f", decimals, value);
|
||||
|
||||
g_object_set(renderer, "text", buffer, NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue