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

Marcel Holtmann
2007-12-18T21:00:07Z

Hi Bastien,

> > > 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.

then we should not use an object for the singleton support. The overhead
for an application to get it right is too much. The singleton support
should be as less intrusive as possible.

So maybe something like bluetooth_instance_init(...) and a corresponding
bluetooth_instance_cleanup() would be better.

This is purely from the application standpoint. If it internally uses an
BluetoothInstance object, I don't really care.

Regards

Marcel