Call the get_date functions with timestamp_t instead of struct tm

This is the much more natural way to use this function, now that I look at
it...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-04-24 21:05:57 -07:00
parent 1e0bc8a1ab
commit 4587f8a274
3 changed files with 21 additions and 17 deletions

View file

@ -258,7 +258,6 @@ static void date_data_func(GtkTreeViewColumn *col,
gpointer data)
{
int idx, nr;
struct tm tm;
timestamp_t when;
/* this should be enought for most languages. if not increase the value. */
char *buffer;
@ -266,11 +265,10 @@ static void date_data_func(GtkTreeViewColumn *col,
gtk_tree_model_get(model, iter, DIVE_INDEX, &idx, DIVE_DATE, &when, -1);
nr = gtk_tree_model_iter_n_children(model, iter);
utc_mkdate(when, &tm);
if (idx < 0) {
buffer = get_trip_date_string(&tm, nr);
buffer = get_trip_date_string(when, nr);
} else {
buffer = get_dive_date_string(&tm);
buffer = get_dive_date_string(when);
}
g_object_set(renderer, "text", buffer, NULL);
free(buffer);