[next] telepathy-glib: remove tp_protocol_new() from API

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Mon Mar 17 07:25:41 PDT 2014


Module: telepathy-glib
Branch: next
Commit: 4fec60be92b88da93769bb2e4934d5bda14a8784
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=4fec60be92b88da93769bb2e4934d5bda14a8784

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Mon Mar  3 16:05:32 2014 +0100

remove tp_protocol_new() from API

---

 .../telepathy-glib/telepathy-glib-sections.txt     |    1 -
 telepathy-glib/protocol.c                          |    4 +--
 telepathy-glib/protocol.h                          |    4 ---
 tests/dbus/protocol-objects.c                      |   30 +++++---------------
 4 files changed, 9 insertions(+), 30 deletions(-)

diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
index 02c8791..c6e44d0 100644
--- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
@@ -4844,7 +4844,6 @@ TP_TYPE_SVC_PROTOCOL_INTERFACE_AVATARS1
 <TITLE>protocol</TITLE>
 TpProtocol
 TpProtocolClass
-tp_protocol_new
 tp_protocol_new_vardict
 tp_protocol_get_name
 tp_protocol_get_cm_name
diff --git a/telepathy-glib/protocol.c b/telepathy-glib/protocol.c
index 75b3e3f..e0e4456 100644
--- a/telepathy-glib/protocol.c
+++ b/telepathy-glib/protocol.c
@@ -912,7 +912,7 @@ tp_protocol_init (TpProtocol *self)
       TpProtocolPrivate);
 }
 
-/**
+/*
  * tp_protocol_new:
  * @dbus: proxy for the D-Bus daemon; may not be %NULL
  * @cm_name: the connection manager name (such as "gabble")
@@ -926,7 +926,7 @@ tp_protocol_init (TpProtocol *self)
  *
  * Since: 0.11.11
  */
-TpProtocol *
+static TpProtocol *
 tp_protocol_new (TpDBusDaemon *dbus,
     const gchar *cm_name,
     const gchar *protocol_name,
diff --git a/telepathy-glib/protocol.h b/telepathy-glib/protocol.h
index c047ee1..1f7b162 100644
--- a/telepathy-glib/protocol.h
+++ b/telepathy-glib/protocol.h
@@ -67,10 +67,6 @@ struct _TpProtocol
 
 void tp_protocol_init_known_interfaces (void);
 
-TpProtocol *tp_protocol_new (TpDBusDaemon *dbus, const gchar *cm_name,
-    const gchar *protocol_name, const GHashTable *immutable_properties,
-    GError **error);
-
 TpProtocol * tp_protocol_new_vardict (TpDBusDaemon *dbus,
     const gchar *cm_name,
     const gchar *protocol_name,
diff --git a/tests/dbus/protocol-objects.c b/tests/dbus/protocol-objects.c
index 5225e01..8848e4d 100644
--- a/tests/dbus/protocol-objects.c
+++ b/tests/dbus/protocol-objects.c
@@ -125,7 +125,7 @@ test_protocol_properties (Test *test,
   GValueArray *va;
   GHashTable *fixed;
 
-  test->protocol = tp_protocol_new (test->dbus, "example_echo_2",
+  test->protocol = tp_protocol_new_vardict (test->dbus, "example_echo_2",
       "example", NULL, NULL);
   g_assert (test->protocol != NULL);
 
@@ -175,7 +175,7 @@ test_protocol_avatar_properties (Test *test,
   gboolean is_set;
   guint num;
 
-  test->protocol = tp_protocol_new (test->dbus, "example_echo_2",
+  test->protocol = tp_protocol_new_vardict (test->dbus, "example_echo_2",
       "example", NULL, NULL);
   g_assert (test->protocol != NULL);
 
@@ -222,7 +222,7 @@ test_protocol_addressing_properties (Test *test,
 {
   GHashTable *properties = NULL;
 
-  test->protocol = tp_protocol_new (test->dbus, "example_echo_2",
+  test->protocol = tp_protocol_new_vardict (test->dbus, "example_echo_2",
       "example", NULL, NULL);
   g_assert (test->protocol != NULL);
 
@@ -387,9 +387,8 @@ static void
 test_protocol_object (Test *test,
     gconstpointer data G_GNUC_UNUSED)
 {
-  GHashTable *props;
+  GVariant *props;
   TpProtocol *protocol;
-  GVariant *vardict;
 
   g_assert_cmpstr (tp_connection_manager_get_name (test->cm), ==,
       "example_echo_2");
@@ -402,25 +401,11 @@ test_protocol_object (Test *test,
   /* Create a new TpProtocol for the same protocol but by passing it all its
    * immutable properities */
   g_object_get (test->protocol,
-      "protocol-properties", &props,
+      "protocol-properties-vardict", &props,
       NULL);
 
-  protocol = tp_protocol_new (test->dbus, "example_echo_2",
-      "example", props, &test->error);
-  g_assert_no_error (test->error);
-  g_assert (TP_IS_PROTOCOL (protocol));
-
-  check_tp_protocol (protocol);
-
-  vardict = tp_protocol_dup_immutable_properties (test->protocol);
-  g_assert (vardict != NULL);
-  g_assert (g_variant_is_of_type (vardict, G_VARIANT_TYPE_VARDICT));
-
-  g_object_unref (protocol);
-
-  /* Same but using tp_protocol_new_vardict */
   protocol = tp_protocol_new_vardict (test->dbus, "example_echo_2",
-      "example", vardict, &test->error);
+      "example", props, &test->error);
   g_assert_no_error (test->error);
   g_assert (TP_IS_PROTOCOL (protocol));
 
@@ -428,8 +413,7 @@ test_protocol_object (Test *test,
 
   g_object_unref (protocol);
 
-  g_variant_unref (vardict);
-  g_hash_table_unref (props);
+  g_variant_unref (props);
 }
 
 



More information about the telepathy-commits mailing list