Re: GnomeProgram in libgnome



James Henstridge <james daa com au> writes: 
> I am not suggesting that a program would want to call gnome_program_init()
> more than once, but that doing so will create multiple GnomeProgram
> objects, which shouldn't happen if it is meant to be a singleton.
> 
> Also, the functions _preinit, _parse_args and _postinit are provided in
> the case where you may wish to do something between these parts of the
> init process.
> 
> However, if a program decides to use these functions, the only way they
> can create the GnomeProgram instance is with g_object_new(), and that
> instance never gets assigned to the global_program variable, so will never
> be returned by gnome_program_get().  This may cause problems later
> on.

Sounds like it's simply a bug - I don't see any reason you'd want two
GnomeProgram objects.
 
> Having an easy way for libraries to cooperate in argument parsing is a
> good reason to keep gnome_program_init().

It's a good reason to have a function that parses args, anyway.  I
don't know that it justifies gnome_program_init() or GnomeProgram.

But in any case it's too late to change, so it doesn't matter.

Havoc




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