[libgda] Don't use deprecated g_value_get_char() and g_value_set_char()



commit 28654f9dd13439397dacbb42ea7e93d6f59f6e22
Author: Vivien Malerba <malerba gnome-db org>
Date:   Thu Aug 16 22:13:06 2012 +0200

    Don't use deprecated g_value_get_char() and g_value_set_char()
    
    for Glib versions >= 2.32

 libgda-ui/data-entries/gdaui-numeric-entry.c |   34 ++++++++++++++++++++++---
 1 files changed, 30 insertions(+), 4 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-numeric-entry.c b/libgda-ui/data-entries/gdaui-numeric-entry.c
index 270f3f5..de222e7 100644
--- a/libgda-ui/data-entries/gdaui-numeric-entry.c
+++ b/libgda-ui/data-entries/gdaui-numeric-entry.c
@@ -276,20 +276,38 @@ gdaui_numeric_entry_set_property (GObject *object,
                         entry->priv->nb_decimals = g_value_get_uint (value);
                         break;
                 case PROP_DECIMAL_SEP: {
-                        gchar sep = g_value_get_char (value);
+			gchar sep;
+#if GLIB_CHECK_VERSION(2,32,0)
+                        sep = (gchar) g_value_get_schar (value);
+#else
+                        sep = g_value_get_char (value);
+#endif
                         if ((sep == 0) || (sep == '+') || (sep == '-'))
                                 g_warning (_("Decimal separator cannot be the '%c' character"), sep ? sep : '0');
                         else {
-                                entry->priv->decimal_sep = g_value_get_char (value);
+#if GLIB_CHECK_VERSION(2,32,0)
+                                entry->priv->decimal_sep = (gchar) g_value_get_schar (value);
+#else
+				entry->priv->decimal_sep = g_value_get_char (value);
+#endif
                         }
                         break;
                 }
                 case PROP_THOUSANDS_SEP: {
-                        gchar sep = g_value_get_char (value);
+			gchar sep;
+#if GLIB_CHECK_VERSION(2,32,0)
+                        sep = (gchar) g_value_get_schar (value);
+#else
+                        sep = g_value_get_char (value);
+#endif
                         if ((sep == '+') || (sep == '-') || (sep == '_'))
                                 g_warning (_("Decimal thousands cannot be the '%c' character"), sep);
                         else {
-                                entry->priv->thousands_sep = g_value_get_char (value);
+#if GLIB_CHECK_VERSION(2,32,0)
+                                entry->priv->thousands_sep = (gchar) g_value_get_schar (value);
+#else
+				entry->priv->thousands_sep = g_value_get_char (value);
+#endif
                         }
                         break;
                 }
@@ -320,10 +338,18 @@ gdaui_numeric_entry_get_property (GObject *object,
                         g_value_set_uint (value, entry->priv->nb_decimals);
                         break;
                 case PROP_DECIMAL_SEP:
+#if GLIB_CHECK_VERSION(2,32,0)
+                        g_value_set_schar (value, (gint8) entry->priv->decimal_sep);
+#else
                         g_value_set_char (value, entry->priv->decimal_sep);
+#endif
                         break;
                 case PROP_THOUSANDS_SEP:
+#if GLIB_CHECK_VERSION(2,32,0)
+                        g_value_set_schar (value, (gint8) entry->priv->thousands_sep);
+#else
                         g_value_set_char (value, entry->priv->thousands_sep);
+#endif
                         break;
                 default:
                         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]