How to use xfconf to store data like bookmarks
Brian J. Tarricone
bjt23 at cornell.edu
Thu Dec 11 23:46:37 CET 2008
I wouldn't use xfconf for something like this. If you really wanted to,
then yes, I guess you could do bookmark0, bookmark1, and have an
n-bookmarks property to record the number of bookmarks. Or you could
store all the data in string lists, but that's kinda weird.
I'd just either roll your own XML file, or use an XfceRc file.
-b
Mike Massonnet wrote:
> 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
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/xfce4-dev
>
More information about the Xfce4-dev
mailing list