]> saetta.ns0.it Git - libgtkform/commitdiff
Bugfixes due to migration to GDateTime.
authorAndrea Zagli <azagli@libero.it>
Sat, 24 Sep 2011 08:46:39 +0000 (10:46 +0200)
committerAndrea Zagli <azagli@libero.it>
Sat, 24 Sep 2011 08:46:39 +0000 (10:46 +0200)
Setted version 0.4.0.

configure.ac
libgtkform/fielddatetime.c

index 610b9dea798d4d5857303df1b982844dc7d2a8c4..5aa5b82f3903e1021b7f8f6ca780deddf3ee8dc7 100644 (file)
@@ -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])
 
index 8821b57ccb13ef22fb14e6df5a57ec08d879bafb..bcb62a3f93beb14e9516f65b857546b9233d56c9 100644 (file)
@@ -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);
                                }
                }