Re: [Bluez-devel] [PATCH] [RESEND] make bluez GNOME UIs singletons

Bastien Nocera
2007-12-18T20:52:26Z

On Tue, 2007-12-18 at 20:58 +0100, Marcel Holtmann wrote:
> Hi Chris,
>
> > patch looks good to me. One question though, why do we use the
> > extra
> > register function. Can't we include that in the _new function.
> > This
> > would make the code a little simpler. We still have to check
> > if the
> > object creation succeeded.
> >
> > This would require defining GObject properties and get and set
> > operations. Also, the register function is what actually initiates
> > the connection to the bus and requests the bus name. This sort of
> > operation might fail and shouldn't be done in an object constructor.
> > The register function seemed like the simplest solution.
>
> I did it the way I think it should be done to make it a lot simpler. It
> works, but I am not sure if it is the best way. Feel free to improve it.
> The stuff is in the CVS now.

Chris is right, object creation should never fail.