[pygtk] GConf ChangetSet and lists
Peter Moberg
moberg.peter at gmail.com
Wed Jun 14 15:51:40 WST 2006
Yes, I'm aware that it is possible to do it without using a ChangeSet. But
it should be possible to use ChangeSet as well.
As stated in the manual:
"In the future, GConf may also have optimizations so that changing a group
of values with GConfChangeSet<http://developer.gnome.org/doc/API/2.0/gconf/=
gconf-gconf-changeset.html#GConfChangeSet>is
faster than calling
gconf_engine_set()<http://developer.gnome.org/doc/API/2.0/gconf/gconf-gconf=
.html#gconf-engine-set>for
each value. In the future,
GConfChangeSet<http://developer.gnome.org/doc/API/2.0/gconf/gconf-gconf-cha=
ngeset.html#GConfChangeSet>may
also represent an atomic transaction, where all or none of the values
are set; however, for now the operation is *not* atomic."
And that sounds like a good thing :) (even though it's not implemented yet).
And that's why I've chosen to use an ChangeSet for my project (
https://wiki.ubuntu.com/DesktopPanelLookAndFeel). It works good for all
values, except lists. Might this be a bug in the gconf module? The code that
I wrote, should it have worked?
Best Regards
Peter Moberg
On 6/13/06, Mystilleef <mystilleef at gmail.com> wrote:
>
> This is how I set a list in GConf in my app. I don't see the need to
> use ChangeSet.
>
> v1 =3D "a"
> v2 =3D "b"
> import gconf
> client =3D gconf.client_get_default()
> client.set_list("/apps/test/qwerty", gconf.VALUE_STRING, [v1, v2])
>
> Cheers
>
> On 6/13/06, Peter Moberg <moberg.peter at gmail.com> wrote:
> > Hi,
> >
> > I'm trying to use GConf ChangeSet to set a list in GConf.
> >
> > This is how I'm using it:
> > import gconf
> >
> > client =3D gconf.client_get_default(
> > )
> > changeSet =3D gconf.
> > ChangeSet()
> >
> > v1
> > =3D gconf.Value(gconf
> > .VALUE_STRING)
> > v2 =3D
> > gconf.Value(gconf.
> > VALUE_STRING)
> > v1.
> > set_string("a")
> >
> > v2.set_string("b")
> >
> >
> > changeSet.set_list(
> > "/apps/test/qwerty", gconf.VALUE_STRING,
> > [v1,v2])
> >
> > client.
> > commit_change_set(changeSet, True
> > )
> > This doesn't work. '/apps/test/qwerty' is not set, and no error is
> given.
> > Does anyone know how to do this?
> >
> >
> > Best Regards
> > Peter Moberg
> >
> >
> > _______________________________________________
> > pygtk mailing list pygtk at daa.com.au
> > http://www.daa.com.au/mailman/listinfo/pygtk
> > Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20060614/8a29351c/at=
tachment.htm
More information about the pygtk
mailing list