client: add client object instrospection

This commit is contained in:
Wim Taymans 2016-07-20 17:55:02 +02:00
parent e167d30296
commit f7d02c8d77
7 changed files with 232 additions and 4 deletions

View file

@ -149,6 +149,8 @@ pinos_context_finalize (GObject * object)
g_list_free (priv->nodes);
g_list_free (priv->ports);
g_list_free (priv->clients);
g_list_free (priv->channels);
g_clear_object (&priv->subscribe);
g_clear_error (&priv->error);
@ -401,6 +403,13 @@ subscription_cb (PinosSubscribe *subscribe,
priv->daemon = g_object_ref (object);
break;
case PINOS_SUBSCRIPTION_FLAG_CLIENT:
if (event == PINOS_SUBSCRIPTION_EVENT_NEW)
priv->clients = g_list_prepend (priv->clients, object);
else if (event == PINOS_SUBSCRIPTION_EVENT_REMOVE)
priv->clients = g_list_remove (priv->clients, object);
break;
case PINOS_SUBSCRIPTION_FLAG_NODE:
if (event == PINOS_SUBSCRIPTION_EVENT_NEW)
priv->nodes = g_list_prepend (priv->nodes, object);