Re: [Evolution-hackers] Rethinking account management



I thought I might try to illustrate how the GSettings machinery works in
my proposal, and also give a glimpse of the class design I have so far.
Please pardon my obviously amateur Inkscape skills.

In this illustration we have a simple calendar key file.  The ESource
and ECalendarSource objects are the things you would deal with directly.

The ESource will maintain an internal dictionary of extension objects
derived from an abstract ESourceExtension class.  This is how you would
get at the ECalendarSource object:

   ECalendarSource *calendar_source;
   GdkColor color;
   gboolean enabled;

   calendar_source = e_source_get_extension (source, "calendar");

   /* This is how to fetch values from the key file. */
   e_calendar_source_get_color (calendar_source, &color);
   enabled = e_calendar_source_get_enabled (calendar_source);

   /* This change would get propagated back to the key file. */
   e_calendar_source_set_enabled (calendar_source, FALSE);

Every [extension/*] group in a key file will have a similar custom class
derived from ESourceExtension.

PNG image



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