After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 163585 - GConf set on lists doesn't work
GConf set on lists doesn't work
Status: RESOLVED FIXED
Product: gconfmm
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2005-01-10 17:02 UTC by Bryan Forbes
Modified: 2011-01-16 23:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
slist_handle.diff (4.96 KB, patch)
2005-01-10 17:03 UTC, Bryan Forbes
none Details | Review
dodgy_ints.patch (8.30 KB, patch)
2005-01-10 22:18 UTC, Murray Cumming
none Details | Review

Description Bryan Forbes 2005-01-10 17:02:40 UTC
I changed the client example and the name of the list setting methods in the
attached patch to show that setting lists puts in the correct number of
elements, but doesn't set their value correctly.
Comment 1 Bryan Forbes 2005-01-10 17:03:25 UTC
Created attachment 35793 [details] [review]
slist_handle.diff
Comment 2 Murray Cumming 2005-01-10 22:12:35 UTC
So, you solved the first problem. Here is a further patch, but the ints are
garbage. Maybe you could look in case you see something obvious.
Comment 3 Murray Cumming 2005-01-10 22:18:26 UTC
Created attachment 35798 [details] [review]
dodgy_ints.patch
Comment 4 Bryan Forbes 2005-01-24 19:37:30 UTC
I was looking at the gconf internals and they use GPOINTER_TO_INT to convert a
GSList* of ints/bools to a Value list for storing (look at
gconf_value_list_from_primitive_list at
http://cvs.gnome.org/viewcvs/gconf/gconf/gconf-internals.c?rev=1.130&view=auto).
 I think the easiest way to do that would be to reverse that and call
GINT_TO_POINTER on our ints/bools.  I'm still not sure how to handle the doubles.
Comment 5 Murray Cumming 2005-02-14 17:25:39 UTC
Well done. That works for ints and bools. Now we just need to figure out the
floats - there is commented-out test code in the client example.
Comment 6 Bryan Forbes 2005-02-14 22:58:54 UTC
If you look in gconf_value_list_to_primitive_list_destructive of that same file
I posted here earlier, they allocate some space for a gdouble.  We should
probably do it that way.

Here's the code:
[snip]
          case GCONF_VALUE_FLOAT:
            {
              gdouble* d = g_new(gdouble, 1);
              *d = gconf_value_get_float(elem);
              tmp->data = d;
            }
            break;
[snip]
Comment 7 Murray Cumming 2005-03-03 13:18:33 UTC
The default BasicTypesTraits now does this, and it works.