<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi everyone, </p>
<div class="moz-forward-container">
<p>today I am wondering about the standard interface
'org.freedesktop.DBus.ObjectManager', and especially the
'InterfacesRemoved' signal.</p>
<p><br>
</p>
<p>As per the documentation
(<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager</a>),
it is said "The <code class="literal">InterfacesRemoved</code>
signal is emitted whenever an object is removed or it loses one
or more interfaces.".<br>
</p>
<p><br>
</p>
<p>I understand that if object '/path/to/obj' loses its interfaces
'org.iface.one' and 'org.iface.two' then the first argument of
the signal is the object path '/path/to/obj' and the second
interface is an array of the two lost interfaces, so
['org.iface.one', 'org.iface.two'].</p>
<p><br>
</p>
<p>What I'm not sure is when object at '/path/to/obj' is removed.
A trivial example is if I have a phone book application which
creates contacts at '/com/test/PhoneBook/Contacts/1',
'/com/test/PhoneBook/Contacts/2', etc. and one contact is
removed. This contacts (or more generally the removed object
path) might implement several interfaces, and my question today
is: 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)?</p>
<p><br>
</p>
<p>I can't find any documentation on this, and since I am writing
a binding, it's important that I get this right. My instincts
tells me the latter is the best, because I can see several
disadvantages to the former:</p>
<p>- you have to do extra-work at the moment you delete the object
path: you need to list the interfaces and send them</p>
<p>- it makes more data to transmit</p>
<p>- the receiver must also make extra work: removing all
interfaces, and checking if the object path has any interfaces
left, if no, delete it</p>
<p>- I can totally see a problem with this when the receiver and
the sender are not synced and at the moment the signal is
received, the list of interfaces are not the same on both sides.</p>
<p><br>
</p>
<p>So while waiting for your answer, I have implemented the latter
method: whenever an object path is removed, I send an empty
array which is a clear signal to delete the whole object path.</p>
<p><br>
</p>
<p>Can you confirm?</p>
<p><br>
</p>
<p>Thanks in advance, <br>
</p>
<p>cheers!<br>
</p>
</div>
</body>
</html>