Pelagicore / gdbus-codegen-glibmm

Code generator for C++ D-Bus stubs and proxies using Giomm/Glibmm
GNU Lesser General Public License v2.1
23 stars 25 forks source link

Remove (or rework?) deprecated connect() method in stub #54

Closed martin-ejdestig closed 5 years ago

martin-ejdestig commented 5 years ago

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?

martin-ejdestig commented 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.

martin-ejdestig commented 5 years ago

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?

mardy commented 5 years ago

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.

kursatkobya commented 5 years ago

I agree, it is better removed than creating confusions. I believe version 2 is not used with connect method by anyone anyways.