Closed martin-ejdestig closed 5 years ago
Perhaps a bit of a separate issue, but looking at other GDBus users, some of them unregister objects when the name is lost. There is no unregister_object() to go together with register_object(). But user can save returned id from register_object() and call Gio::DBus::Connection::unregister_object() themselves
... Not sure how common it would be to do that... probably does not make sense for the process to keep running if it looses the name.
Sleeping on it, I think it is better to just remove it. Having a helper object or something being flexible enough would just mean ending up with something very similar to the Gio::DBus::own_name() (signals/callbacks for connected/name acquired/lost etc.).
Or what do you think?
I'd vote for removing it, but first I need to check with other users of the project, to make sure they are not using it.
I agree, it is better removed than creating confusions. I believe version 2 is not used with connect method by anyone anyways.
Not sure what the policy for backwards compatibility is, hence this issue instead of a pull request.
It is confusing to have it in the generated code.
Or perhaps maybe rework it? I guess the original intention was to hide the Gio::DBus::own_name() call from the user but the current implementation has some shortcomings (not possible to register multiple objects, nothing is done in name lost callback etc.) so register_object() was added in 92d9f83ddc5cdaa2cde95773b50b25ce0832d821 .
But perhaps it makes sense to have some convenience API for Gio::DBus::own_name()? It just has to be more flexible?