Re: GnomeSettingsModule



On Wed, 2007-03-28 at 18:11 +0200, Jens Granseuer wrote:
> On 28.03.2007 15:55, Rodrigo Moya wrote:
> > GType
> > gnome_settings_module_get_type (void)
> > {
> > 	static GType module_type = 0;
> >   
> > 	if (!module_type) {
> > 		static const GTypeInfo module_info = {
> > 			sizeof (GnomeSettingsModuleClass),
> > 			NULL,		/* base_init */
> > 			NULL,		/* base_finalize */
> > 			(GClassInitFunc) gnome_settings_module_class_init,
> > 			NULL,		/* class_finalize */
> > 			NULL,		/* class_data */
> > 			sizeof (GnomeSettingsModule),
> > 			0,		/* n_preallocs */
> > 			(GInstanceInitFunc) gnome_settings_module_init,
> > 		};
> 
> If I'm not mistaken, Christian Persch and others were on a quest to make
> these non-static sometime during 2.17.
> 
what exactly should be non-static?

> > 	/* virtual methods */
> > 	gboolean (* initialize) (GnomeSettingsModule *module);
> > 	gboolean (* load) (GnomeSettingsModule *module);
> > 	gboolean (* unload) (GnomeSettingsModule *module);
> > 	gboolean (* reload_settings) (GnomeSettingsModule *module);
> 
> This looks a little inconsistent to me. Why "load" and "unload",
> but "reload_settings" instead of "reload"?
> 
right, the fact is that load/unload are really _run/_shutdown, which are
the ones I used initially

> reload might also offer a default implementation which could simply be
> 
> unload ();
> load ();
> 
> Not quite sure if it's worth it, though.
>
reload_settings is for just reloading the settings, not reloading the
whole module, so not sure what to use. Since we are talking about
settings modules, I guess we can do what you say, and have this default
implementation, but not sure if that would fit all modules (like typing
break, for instance, it's not the same to tell it to reload the settings
than to reload itself, which means removing the systray icon and
re-adding it again).

But I guess that's an implementation detail, and what we really want is
to tell the modules to load/unload and reload the settings, so I think
I'll do what you say.
-- 
Rodrigo Moya <rodrigo gnome-db org>




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