XfconfChannel support for plugins.

Brian J. Tarricone bjt23 at cornell.edu
Mon Oct 13 20:10:29 CEST 2008


Nick Schermer wrote:
> Hi,
> 
> I can image some plugin writers want to use Xfconf for storing their
> properties. The panel api can help them with this, but the question
> is, do we want the settings for each plugin in 1 or separate channels.
> 
> I have no intentions to link xfconf to libxfce4panel, so 2 possibilities remain:
> 
> Multiple plugins in 1 channel:
> gchar *xfce_panel_plugin_get_xfconf_property (XfcePanelPlugin *plugin,
> const gchar *property);
> 
> this will return > /plugins/{plugin_name}-{plugin_id}/{property} so i
> can be used for  xfconf_channel_get_*
> using the panel channel.
> 
> Or
> gchar *xfce_panel_plugin_get_xfconf_channel_name (XfcePanelPlugin *plugin);
> 
> Which returns
> {plugin_name}-{plugin_id}
> 
> Any ideas here?

I was thinking about something similar for the xfce4-session splash 
engines this morning.  Right now they use XfceRc as well.

Need to look into it more, but I'm planning on just passing around 
GHashTables full of properties as (gchar *, GValue *) pairs.  That way 
the splash engines don't need to know what kind of config system is 
being used, and nothing needs to change in them if we change systems 
again.  xfce4-session will handle emptying out the GHashTable, 
prepending appropriate property names, and storing the result in xfconf 
(as well as the reverse).

So I guess you could do something similar for the panel.  Of course, 
that leaves out the ability to fetch one property at a time, but in 
practice, I think most (all?) plugins read all their settings at startup 
and rewrite all of them whenever the user changes the settings, so it's 
not a big deal.

Personally I'd say a single xfce4-panel-plugins channel would be ok, 
BUT: only if you remove old config branches when a plugin is removed. 
Otherwise channels could end up getting very large, and xfconfd parses 
the entire channel whenever you read a single property from the channel. 
  I know we don't unlink() the old config files when a plugin gets 
removed today, but personally I've always thought we should.  The only 
times I've cared about losing config files is when I'm doing development 
on a plugin that I've removed and re-added a lot, which I don't think is 
the use case the system should be designed around (nowadays I just 
restart the entire panel to get around that).

	-brian



More information about the Xfce4-dev mailing list