Re: Strategies for multiple gconf notifications



tor, 10 05 2007 kl. 23:15 +0200, skrev Simon Holm Th�en:
> tor, 10 05 2007 kl. 12:41 +0200, skrev Murray Cumming:
> > If I have an intensive process that should be rerun in response to any
> > one of twenty configuration keys, how might I prevent my application
> > from re-running that process 20 times instead of just once, when
> > changing all the keys at one time.
> > 
> > I guess I could just append each notification key to a GList, and use a
> > g_timeout handler to notify my application about batches of changes, if
> > anything changed, at regular intervals.
> > 
> > Or is there some existing API or known strategy to deal with this
> > situation?
> > 
> I believe GConfChangeSet[1] is what you're looking for.
> 
> [1] http://developer.gnome.org/doc/API/2.0/gconf/gconf-gconf-changeset.html
> 
Bah! The doc mentions it isn't atomic for now, and this isn't even what
you're asking, you want it the other way around. Sorry.

I guess that if the type of the configuration values all are the same,
you could set them under a single configuration key as a list of that
type. Otherwise, delaying notification of changes to the application
until you haven't received a gconf notification for x seconds sounds
like a simple and reasonable solution.


Simon Holm Th�en




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]