edbus: Allow to monitor unique id in edbus_name_owner_changed_callback_add

This allows to monitor when a client exits. Clients in general don't
register a name in the bus and in some cases it's even not allowed to do
(for example an agent talking to bluetoothd, that runs in system bus).

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 80687
This commit is contained in:
José Roberto de Souza 2012-12-11 19:50:06 +00:00 committed by Lucas De Marchi
parent 00e6dac1ac
commit 5a49f65f6f
1 changed files with 5 additions and 2 deletions

View File

@ -493,12 +493,15 @@ edbus_connection_name_get(EDBus_Connection *conn, const char *name)
cn->name = eina_stringshare_add(name);
cn->objects = eina_hash_string_superfast_new(NULL);
if (name[0] == ':' || !strcmp(name, EDBUS_FDO_BUS))
if (!strcmp(name, EDBUS_FDO_BUS))
{
cn->unique_id = eina_stringshare_add(name);
goto end;
}
edbus_name_owner_get(conn, cn->name, on_get_name_owner, cn);
else if (name[0] == ':')
cn->unique_id = eina_stringshare_add(name);
else
edbus_name_owner_get(conn, cn->name, on_get_name_owner, cn);
cn->name_owner_changed = _edbus_signal_handler_add(conn, EDBUS_FDO_BUS,
EDBUS_FDO_PATH,
EDBUS_FDO_INTERFACE,