diff options
author | Tristan Van Berkom <tvb@src.gnome.org> | 2006-08-22 18:43:19 +0000 |
---|---|---|
committer | Tristan Van Berkom <tvb@src.gnome.org> | 2006-08-22 18:43:19 +0000 |
commit | 03ae74e36be9ef954b58a04273e19c6eab0283d0 (patch) | |
tree | 1686370cc5e3830570e86924a65e60661b83b194 /src/glade-property-class.c | |
parent | c032eaca508684d67316128fc92efaa24da0fec9 (diff) | |
download | glade-03ae74e36be9ef954b58a04273e19c6eab0283d0.tar.gz |
Reverted to use of floating point precision in adjustments - use non
* src/glade-editor-property.c, src/glade-property-class.c: Reverted to use
of floating point precision in adjustments - use non locale specific
functions to write them out.
Diffstat (limited to 'src/glade-property-class.c')
-rw-r--r-- | src/glade-property-class.c | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/src/glade-property-class.c b/src/glade-property-class.c index 3cbcaa18..c6fcdb17 100644 --- a/src/glade-property-class.c +++ b/src/glade-property-class.c @@ -392,14 +392,36 @@ glade_property_class_make_string_from_object (GladePropertyClass *property_class } else if (property_class->pspec->value_type == GTK_TYPE_ADJUSTMENT) { +#define FLOAT_BUFSIZ 128 + GtkAdjustment *adj = GTK_ADJUSTMENT (object); - - /* Glade format expects integers */ - string = g_strdup_printf ("%d %d %d %d %d %d", - (gint)adj->value, (gint)adj->lower, (gint)adj->upper, - (gint)adj->step_increment, - (gint)adj->page_increment, - (gint)adj->page_size); + GString *str = g_string_new (""); + gchar buff[FLOAT_BUFSIZ]; + + g_ascii_dtostr (buff, FLOAT_BUFSIZ, adj->value); + g_string_append (str, buff); + + g_string_append_c (str, ' '); + g_ascii_dtostr (buff, FLOAT_BUFSIZ, adj->lower); + g_string_append (str, buff); + + g_string_append_c (str, ' '); + g_ascii_dtostr (buff, FLOAT_BUFSIZ, adj->upper); + g_string_append (str, buff); + + g_string_append_c (str, ' '); + g_ascii_dtostr (buff, FLOAT_BUFSIZ, adj->step_increment); + g_string_append (str, buff); + + g_string_append_c (str, ' '); + g_ascii_dtostr (buff, FLOAT_BUFSIZ, adj->page_increment); + g_string_append (str, buff); + + g_string_append_c (str, ' '); + g_ascii_dtostr (buff, FLOAT_BUFSIZ, adj->page_size); + g_string_append (str, buff); + + string = g_string_free (str, FALSE); } else if ((gwidget = glade_widget_get_from_gobject (object)) != NULL) string = g_strdup (gwidget->name); |