aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-08-10 13:43:16 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-08-10 13:43:16 -0700
commit3c542b5a418751f22511f6b1d554252c6e472a43 (patch)
tree3a795e5906a1cdd357d3c239041118cc2141333e
parent19621bf481c68955184c11dd407c59af4a05130e (diff)
downloadsubsurface-3c542b5a418751f22511f6b1d554252c6e472a43.tar.gz
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>
-rw-r--r--divelist.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/divelist.c b/divelist.c
index ce61d20d1..1d31da567 100644
--- a/divelist.c
+++ b/divelist.c
@@ -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);
}