diff options
author | Regis Merlino <regis.merlino@intel.com> | 2013-07-23 11:28:08 +0200 |
---|---|---|
committer | Regis Merlino <regis.merlino@intel.com> | 2013-07-23 11:28:08 +0200 |
commit | 9b89bf5fe1521fbcd004f74e2cf0e54f327a5e70 (patch) | |
tree | 9af78fc1561a87bb16cbe6e4ffb3e5784e34e504 | |
parent | 2842f257f7637f4cb7e0de604b18e506642419fc (diff) | |
download | dleyna-connector-dbus-9b89bf5fe1521fbcd004f74e2cf0e54f327a5e70.tar.gz |
[Connector] Change publish_object() signature
The interface_index parameter relates to the corresponding xml
part from the introspection data passed to initialize().
This was convenient for the d-bus connector implementation, but
required xml parsing for other connector implementations.
This commit replaces the interface_index parameter with the
actual interface name to avoid the xml parsing task.
Signed-off-by: Regis Merlino <regis.merlino@intel.com>
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/connector-dbus.c | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 32a880f..392f756 100644 --- a/configure.ac +++ b/configure.ac @@ -79,7 +79,7 @@ AC_ARG_ENABLE(master-build,, [master_build=no]) AS_IF([test "x$master_build" = "xno"], - [PKG_CHECK_MODULES([DLEYNA_CORE], [dleyna-core-1.0 >= 0.0.1])], + [PKG_CHECK_MODULES([DLEYNA_CORE], [dleyna-core-1.0 >= 0.2.1])], [DLEYNA_CORE_CFLAGS="-I../dleyna-core"; DLEYNA_CORE_LIBS="-L../dleyna-core/.libs -ldleyna-core-1.0" ]) diff --git a/src/connector-dbus.c b/src/connector-dbus.c index b93d14c..0e16239 100644 --- a/src/connector-dbus.c +++ b/src/connector-dbus.c @@ -319,13 +319,21 @@ static void prv_connector_set_client_lost_cb( } static GDBusInterfaceInfo *prv_find_interface_info(gboolean root, - guint interface_index) + const gchar *interface_name) { GDBusNodeInfo *node; + GDBusInterfaceInfo **interface; node = (root) ? g_context.root_node_info : g_context.server_node_info; - return node->interfaces[interface_index]; + interface = node->interfaces; + while (*interface) { + if (!strcmp(interface_name, (*interface)->name)) + break; + interface++; + } + + return *interface; } static void prv_object_method_call(GDBusConnection *conn, @@ -372,7 +380,7 @@ static guint prv_connector_publish_object( dleyna_connector_id_t connection, const gchar *object_path, gboolean root, - guint interface_index, + const gchar* interface_name, const dleyna_connector_dispatch_cb_t *cb_table_1) { guint object_id; @@ -384,7 +392,7 @@ static guint prv_connector_publish_object( object = g_new0(dleyna_dbus_object_t, 1); - info = prv_find_interface_info(root, interface_index); + info = prv_find_interface_info(root, interface_name); object_id = g_dbus_connection_register_object( (GDBusConnection *)connection, object_path, |