From c3ad1c6335f69e0961bb938350a9224bc6584a1d Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sat, 24 Sep 2011 10:46:39 +0200 Subject: [PATCH] Bugfixes due to migration to GDateTime. Setted version 0.4.0. --- configure.ac | 2 +- libgtkform/fielddatetime.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 610b9de..5aa5b82 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([libgtkform], [0.3.1], [azagli@libero.it]) +AC_INIT([libgtkform], [0.4.0], [azagli@libero.it]) AC_CONFIG_SRCDIR([libgtkform/form.c]) AC_CONFIG_HEADER([config.h]) diff --git a/libgtkform/fielddatetime.c b/libgtkform/fielddatetime.c index 8821b57..bcb62a3 100644 --- a/libgtkform/fielddatetime.c +++ b/libgtkform/fielddatetime.c @@ -590,7 +590,7 @@ gtk_form_field_datetime_set_from_hashtable (GtkFormField *field, GHashTable *has GtkFormFieldDateTimePrivate *priv; gchar *field_name; GValue *gval; - struct tm *datetime; + GDateTime *datetime; gchar *value; g_return_val_if_fail (IS_GTK_FORM_FIELD_DATETIME (field), FALSE); @@ -611,15 +611,15 @@ gtk_form_field_datetime_set_from_hashtable (GtkFormField *field, GHashTable *has } else { - datetime = (struct tm *)g_value_get_pointer (gval); + datetime = (GDateTime *)g_value_get_pointer (gval); - value = gtk_form_field_datetime_get_str_from_tm (datetime, priv->display_format); + value = g_date_time_format (datetime, priv->display_format); - ret = gtk_form_field_datetime_set_value_stringify (field, value); + ret = gtk_form_field_datetime_set_value_stringify (field, value != NULL ? value : ""); - priv->original_value = g_memdup (datetime, sizeof (struct tm)); + priv->original_value = g_date_time_ref (datetime); - g_free (datetime); + g_date_time_unref (datetime); g_free (value); } } -- 2.49.0