blob: 11642514f05577cb9a2b9da407492d98493eb3f4 [file] [log] [blame]
Norman James708e2432015-10-31 17:26:40 -05001#include "object_mapper.h"
2
3
4void
5emit_object_added(GDBusObjectManager *manager)
6{
7 GList *objects;
8 GList *l;
9
10 objects = g_dbus_object_manager_get_objects(manager);
11 for (l = objects; l != NULL; l = l->next)
12 {
13 GDBusObject *object = l->data;
14 ObjectMapper* map = object_get_object_mapper((Object*)object);
15
16 GList *interfaces;
17 GList *ll;
18 const gchar *object_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
19
20 interfaces = g_dbus_object_get_interfaces(G_DBUS_OBJECT(object));
21 for (ll = interfaces; ll != NULL; ll = ll->next)
22 {
23 GDBusInterface *interface = G_DBUS_INTERFACE(ll->data);
24 object_mapper_emit_object_added(map,object_path,
25 g_dbus_interface_get_info(interface)->name);
26 }
27 g_list_free_full(interfaces, g_object_unref);
28 }
29 g_list_free_full(objects, g_object_unref);
30}
31