How to use xfconf to store data like bookmarks

Mike Massonnet mmassonnet at gmail.com
Thu Dec 11 22:43:15 CET 2008


Hi,

First, this thread is probably just useless noise ;-)

I'm wondering how I can use xfconf to store something like this:

<bookmarks>
  <bookmark>
    <name>foo</name>
    <location>bar</location>
  </bookmark>
  <bookmark>
    ...
  </bookmark>
</bookmarks>

and I'm looking for opinions.

I could do it like xfdesktop does it for the backdrop screens, store the
bookmark suffixed with an incrementing number: bookmark0, bookmark1, ...

Then I don't know what should happen when the user deletes bookmark1
when there is bookmark0 and bookmark2.  As it is only an id, I think
about searching id after id for a placeholder, in which case it could
also be a random generated id that would make the algorithm to find a
placeholder faster.

And then the id could also be made as a unique identifier, based on the
name in my case.  However in that case the id must be cleaned up for
invalid characters.  That's possible with g_strcanon() where it would
be nice that xfconf provides a define name like
XFCONF_PROPERTY_NAME_VALIDCHARS.

Which brings me to the only conclusion that what I really want is a
unique name...  I told ya, prolly just useless noise.

Thanks,
Mike



More information about the Xfce4-dev mailing list