Fwd: How to (correctly) signal that a DBusObject was removed?
Simon McVittie
smcv at collabora.com
Tue May 9 16:00:01 UTC 2017
On Tue, 09 May 2017 at 10:11:33 +0200, Nicolas SCHOEMAEKER wrote:
> The
> InterfacesRemoved signal is emitted whenever an object is removed or it loses
> one or more interfaces. [...] should I emit the
> signal with all of the object's interfaces in the second argument, OR should I
> emit the signal with the second argument empty (thus "empty" being a special
> case to signal that the entire object path is removed)?
I believe the intention was the former. Is there some document
or implementation that suggested to you that it might be the latter?
If the special case with an empty list had this meaning, then I would hope
that the API documentation would have described it. The only interpretation
of the current text that I can see is that InterfacesRemoved("/foo", [])
indicates that no interfaces were removed; there is no point in emitting
that signal, but inventing a special-cased meaning for it seems like
a stretch.
The closest thing to a reference implementation of ObjectManager is
GDBus in GLib, so you should do whatever GDBusObjectManagerServer does.
Please open a dbus bug report describing what that is, so the specification
can be clarified (a patch for doc/dbus-specification.xml.in would be very
much appreciated).
<https://bugzilla.gnome.org/show_bug.cgi?id=781524> is also relevant,
and suggests that the answer is that the removal of each interface is
reported (no special case).
> My instincts tells me the latter is the best,
> because I can see several disadvantages to the former
If this had been raised at the time ObjectManager was designed, perhaps
the latter (or a separate ObjectRemoved signal) would have been a more
elegant design for the reasons you mentioned. However, it's too late
to make incompatible changes to that interface now that there are both
client and server implementations in practical use.
S
More information about the dbus
mailing list