[glib/gdbus-merge] remove the redundant interface_name parameter



commit 107b4d4bae7dba4281bfaa0bef827f7b2376946a
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu May 13 13:09:58 2010 -0400

    remove the redundant interface_name parameter

 gio/gdbusconnection.c            |   12 +++++-------
 gio/gdbusconnection.h            |    1 -
 gio/tests/gdbus-example-export.c |    1 -
 gio/tests/gdbus-example-peer.c   |    1 -
 gio/tests/gdbus-example-server.c |    1 -
 gio/tests/gdbus-export.c         |   12 ------------
 gio/tests/gdbus-peer.c           |    2 --
 7 files changed, 5 insertions(+), 25 deletions(-)
---
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index dd49189..6967ac0 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -3894,7 +3894,6 @@ obj_message_func (GDBusConnection *connection,
  * g_dbus_connection_register_object:
  * @connection: A #GDBusConnection.
  * @object_path: The object path to register at.
- * @interface_name: The D-Bus interface to register.
  * @introspection_data: Introspection data for the interface.
  * @vtable: A #GDBusInterfaceVTable to call into or %NULL.
  * @user_data: Data to pass to functions in @vtable.
@@ -3902,7 +3901,7 @@ obj_message_func (GDBusConnection *connection,
  * @error: Return location for error or %NULL.
  *
  * Registers callbacks for exported objects at @object_path with the
- * D-Bus interface @interface_name.
+ * D-Bus interface that is described in @introspection_data.
  *
  * Calls to functions in @vtable (and @user_data_free_func) will
  * happen in the <link linkend="g-main-context-push-thread-default">thread-default main
@@ -3943,7 +3942,6 @@ obj_message_func (GDBusConnection *connection,
 guint
 g_dbus_connection_register_object (GDBusConnection            *connection,
                                    const gchar                *object_path,
-                                   const gchar                *interface_name,
                                    const GDBusInterfaceInfo   *introspection_data,
                                    const GDBusInterfaceVTable *vtable,
                                    gpointer                    user_data,
@@ -3957,8 +3955,8 @@ g_dbus_connection_register_object (GDBusConnection            *connection,
   g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), 0);
   g_return_val_if_fail (!g_dbus_connection_is_closed (connection), 0);
   g_return_val_if_fail (object_path != NULL && g_variant_is_object_path (object_path), 0);
-  g_return_val_if_fail (interface_name == NULL || g_dbus_is_interface_name (interface_name), 0);
   g_return_val_if_fail (introspection_data != NULL, 0);
+  g_return_val_if_fail (g_dbus_is_interface_name (introspection_data->name), 0);
   g_return_val_if_fail (error == NULL || *error == NULL, 0);
 
   ret = 0;
@@ -3978,14 +3976,14 @@ g_dbus_connection_register_object (GDBusConnection            *connection,
       g_hash_table_insert (connection->priv->map_object_path_to_eo, eo->object_path, eo);
     }
 
-  ei = g_hash_table_lookup (eo->map_if_name_to_ei, interface_name);
+  ei = g_hash_table_lookup (eo->map_if_name_to_ei, introspection_data->name);
   if (ei != NULL)
     {
       g_set_error (error,
                    G_IO_ERROR,
                    G_IO_ERROR_EXISTS,
                    _("An object is already exported for the interface %s at %s"),
-                   interface_name,
+                   introspection_data->name,
                    object_path);
       goto out;
     }
@@ -3997,7 +3995,7 @@ g_dbus_connection_register_object (GDBusConnection            *connection,
   ei->user_data_free_func = user_data_free_func;
   ei->vtable = vtable;
   ei->introspection_data = introspection_data;
-  ei->interface_name = g_strdup (interface_name);
+  ei->interface_name = g_strdup (introspection_data->name);
   ei->context = g_main_context_get_thread_default ();
   if (ei->context != NULL)
     g_main_context_ref (ei->context);
diff --git a/gio/gdbusconnection.h b/gio/gdbusconnection.h
index bb5475d..3299777 100644
--- a/gio/gdbusconnection.h
+++ b/gio/gdbusconnection.h
@@ -308,7 +308,6 @@ struct _GDBusInterfaceVTable
 
 guint            g_dbus_connection_register_object            (GDBusConnection            *connection,
                                                                const gchar                *object_path,
-                                                               const gchar                *interface_name,
                                                                const GDBusInterfaceInfo   *introspection_data,
                                                                const GDBusInterfaceVTable *vtable,
                                                                gpointer                    user_data,
diff --git a/gio/tests/gdbus-example-export.c b/gio/tests/gdbus-example-export.c
index 9dee12f..5dda58d 100644
--- a/gio/tests/gdbus-example-export.c
+++ b/gio/tests/gdbus-example-export.c
@@ -272,7 +272,6 @@ on_bus_acquired (GDBusConnection *connection,
                     G_CALLBACK (send_property_change), connection);
   registration_id = g_dbus_connection_register_object (connection,
                                                        "/org/myorg/MyObject",
-                                                       "org.myorg.MyObject",
                                                        introspection_data->interfaces[0],
                                                        &interface_vtable,
                                                        myobj,
diff --git a/gio/tests/gdbus-example-peer.c b/gio/tests/gdbus-example-peer.c
index 118624f..1a11c6d 100644
--- a/gio/tests/gdbus-example-peer.c
+++ b/gio/tests/gdbus-example-peer.c
@@ -146,7 +146,6 @@ on_new_connection (GDBusServer *server,
   g_object_ref (connection);
   registration_id = g_dbus_connection_register_object (connection,
                                                        "/org/gtk/GDBus/TestObject",
-                                                       "org.gtk.GDBus.TestPeerInterface",
                                                        introspection_data->interfaces[0],
                                                        &interface_vtable,
                                                        NULL,  /* user_data */
diff --git a/gio/tests/gdbus-example-server.c b/gio/tests/gdbus-example-server.c
index c4574cd..93dd53a 100644
--- a/gio/tests/gdbus-example-server.c
+++ b/gio/tests/gdbus-example-server.c
@@ -327,7 +327,6 @@ on_bus_acquired (GDBusConnection *connection,
 
   registration_id = g_dbus_connection_register_object (connection,
                                                        "/org/gtk/GDBus/TestObject",
-                                                       "org.gtk.GDBus.TestInterface",
                                                        introspection_data->interfaces[0],
                                                        &interface_vtable,
                                                        NULL,  /* user_data */
diff --git a/gio/tests/gdbus-export.c b/gio/tests/gdbus-export.c
index 77d7303..ff6cc28 100644
--- a/gio/tests/gdbus-export.c
+++ b/gio/tests/gdbus-export.c
@@ -983,7 +983,6 @@ test_object_registration (void)
 
   registration_id = g_dbus_connection_register_object (c,
                                                        "/foo/boss",
-                                                       foo_interface_info.name,
                                                        &foo_interface_info,
                                                        &foo_vtable,
                                                        &data,
@@ -996,7 +995,6 @@ test_object_registration (void)
 
   registration_id = g_dbus_connection_register_object (c,
                                                        "/foo/boss",
-                                                       bar_interface_info.name,
                                                        &bar_interface_info,
                                                        NULL,
                                                        &data,
@@ -1009,7 +1007,6 @@ test_object_registration (void)
 
   registration_id = g_dbus_connection_register_object (c,
                                                        "/foo/boss/worker1",
-                                                       foo_interface_info.name,
                                                        &foo_interface_info,
                                                        NULL,
                                                        &data,
@@ -1022,7 +1019,6 @@ test_object_registration (void)
 
   registration_id = g_dbus_connection_register_object (c,
                                                        "/foo/boss/worker2",
-                                                       bar_interface_info.name,
                                                        &bar_interface_info,
                                                        NULL,
                                                        &data,
@@ -1035,7 +1031,6 @@ test_object_registration (void)
 
   registration_id = g_dbus_connection_register_object (c,
                                                        "/foo/boss/interns/intern1",
-                                                       foo_interface_info.name,
                                                        &foo_interface_info,
                                                        NULL,
                                                        &data,
@@ -1049,7 +1044,6 @@ test_object_registration (void)
   /* ... and try again at another path */
   registration_id = g_dbus_connection_register_object (c,
                                                        "/foo/boss/interns/intern2",
-                                                       bar_interface_info.name,
                                                        &bar_interface_info,
                                                        NULL,
                                                        &data,
@@ -1063,7 +1057,6 @@ test_object_registration (void)
   /* register at the same path/interface - this should fail */
   registration_id = g_dbus_connection_register_object (c,
                                                        "/foo/boss/interns/intern2",
-                                                       bar_interface_info.name,
                                                        &bar_interface_info,
                                                        NULL,
                                                        &data,
@@ -1078,7 +1071,6 @@ test_object_registration (void)
   /* register at different interface - shouldn't fail */
   registration_id = g_dbus_connection_register_object (c,
                                                        "/foo/boss/interns/intern2",
-                                                       foo_interface_info.name,
                                                        &foo_interface_info,
                                                        NULL,
                                                        &data,
@@ -1097,7 +1089,6 @@ test_object_registration (void)
   /* register it back */
   registration_id = g_dbus_connection_register_object (c,
                                                        "/foo/boss/interns/intern2",
-                                                       foo_interface_info.name,
                                                        &foo_interface_info,
                                                        NULL,
                                                        &data,
@@ -1110,7 +1101,6 @@ test_object_registration (void)
 
   registration_id = g_dbus_connection_register_object (c,
                                                        "/foo/boss/interns/intern3",
-                                                       bar_interface_info.name,
                                                        &bar_interface_info,
                                                        NULL,
                                                        &data,
@@ -1167,7 +1157,6 @@ test_object_registration (void)
    */
   registration_id = g_dbus_connection_register_object (c,
                                                        "/foo/boss/executives/non_subtree_object",
-                                                       bar_interface_info.name,
                                                        &bar_interface_info,
                                                        NULL,
                                                        &data,
@@ -1179,7 +1168,6 @@ test_object_registration (void)
   num_successful_registrations++;
   registration_id = g_dbus_connection_register_object (c,
                                                        "/foo/boss/executives/non_subtree_object",
-                                                       foo_interface_info.name,
                                                        &foo_interface_info,
                                                        NULL,
                                                        &data,
diff --git a/gio/tests/gdbus-peer.c b/gio/tests/gdbus-peer.c
index 8571e73..b0e4977 100644
--- a/gio/tests/gdbus-peer.c
+++ b/gio/tests/gdbus-peer.c
@@ -243,7 +243,6 @@ on_new_connection (GDBusServer *server,
   error = NULL;
   reg_id = g_dbus_connection_register_object (connection,
                                               "/org/gtk/GDBus/PeerTestObject",
-                                              "org.gtk.GDBus.PeerTestInterface",
                                               test_interface_introspection_data,
                                               &test_interface_vtable,
                                               data,
@@ -331,7 +330,6 @@ on_incoming_connection (GSocketService     *service,
       error = NULL;
       reg_id = g_dbus_connection_register_object (connection,
                                                   "/org/gtk/GDBus/PeerTestObject",
-                                                  "org.gtk.GDBus.PeerTestInterface",
                                                   &test_interface_introspection_data,
                                                   &test_interface_vtable,
                                                   data,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]