[next] telepathy-glib: rename tp_base_connection_disconnect_with_dbus_error_vardict

Guillaume Desmottes gdesmott at kemper.freedesktop.org
Thu Feb 27 06:07:35 PST 2014


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

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Tue Feb 18 17:29:32 2014 +0100

rename tp_base_connection_disconnect_with_dbus_error_vardict

---

 .../telepathy-glib/telepathy-glib-sections.txt     |    2 +-
 telepathy-glib/base-connection.c                   |    4 +-
 telepathy-glib/base-connection.h                   |    2 +-
 tests/dbus/connection-error.c                      |   45 ++++++--------------
 4 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
index fb59438..c0f2174 100644
--- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
@@ -56,7 +56,7 @@ tp_base_connection_get_status
 tp_base_connection_is_destroyed
 tp_base_connection_check_connected
 tp_base_connection_change_status
-tp_base_connection_disconnect_with_dbus_error_vardict
+tp_base_connection_disconnect_with_dbus_error
 tp_base_connection_finish_shutdown
 tp_base_connection_add_interfaces
 TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED
diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index aa62d2e..4574716 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -1730,7 +1730,7 @@ void tp_base_connection_finish_shutdown (TpBaseConnection *self)
 }
 
 /**
- * tp_base_connection_disconnect_with_dbus_error_vardict: (skip)
+ * tp_base_connection_disconnect_with_dbus_error: (skip)
  * @self: The connection
  * @error_name: The D-Bus error with which the connection changed status to
  *              Disconnected
@@ -1765,7 +1765,7 @@ void tp_base_connection_finish_shutdown (TpBaseConnection *self)
  * Since: 0.7.24
  */
 void
-tp_base_connection_disconnect_with_dbus_error_vardict (TpBaseConnection *self,
+tp_base_connection_disconnect_with_dbus_error (TpBaseConnection *self,
     const gchar *error_name,
     GVariant *details,
     TpConnectionStatusReason reason)
diff --git a/telepathy-glib/base-connection.h b/telepathy-glib/base-connection.h
index 6849b03..81610c5 100644
--- a/telepathy-glib/base-connection.h
+++ b/telepathy-glib/base-connection.h
@@ -139,7 +139,7 @@ void tp_base_connection_disconnect_with_error (TpBaseConnection *self,
     const GError *error, GHashTable *details, TpConnectionStatusReason reason);
 */
 
-void tp_base_connection_disconnect_with_dbus_error_vardict (
+void tp_base_connection_disconnect_with_dbus_error (
     TpBaseConnection *self,
     const gchar *error_name,
     GVariant *details,
diff --git a/tests/dbus/connection-error.c b/tests/dbus/connection-error.c
index de19183..cac973c 100644
--- a/tests/dbus/connection-error.c
+++ b/tests/dbus/connection-error.c
@@ -170,7 +170,7 @@ test_registered_error (Test *test,
   tp_cli_connection_connect_to_status_changed (test->conn, on_status_changed,
       test->mainloop, NULL, NULL, NULL);
 
-  tp_base_connection_disconnect_with_dbus_error_vardict (
+  tp_base_connection_disconnect_with_dbus_error (
       test->service_conn_as_base, "com.example.DomainSpecificError", NULL,
       TP_CONNECTION_STATUS_REASON_NETWORK_ERROR);
 
@@ -221,7 +221,7 @@ test_unregistered_error (Test *test,
   tp_cli_connection_connect_to_status_changed (test->conn, on_status_changed,
       test->mainloop, NULL, NULL, NULL);
 
-  tp_base_connection_disconnect_with_dbus_error_vardict (
+  tp_base_connection_disconnect_with_dbus_error (
       test->service_conn_as_base, "net.example.WTF", NULL,
       TP_CONNECTION_STATUS_REASON_NETWORK_ERROR);
 
@@ -264,7 +264,7 @@ test_detailed_error (Test *test,
   GError *error = NULL;
   const GHashTable *asv;
   gchar *str;
-  GVariant *variant;
+  GVariant *variant, *details;
   gboolean ok;
   gint32 bees;
 
@@ -281,35 +281,18 @@ test_detailed_error (Test *test,
   tp_cli_connection_connect_to_status_changed (test->conn, on_status_changed,
       test->mainloop, NULL, NULL, NULL);
 
-  if (!tp_strdiff (mode, "variant"))
-    {
-      GVariant *details = g_variant_parse (G_VARIANT_TYPE_VARDICT,
-          "{ 'debug-message': <'not enough bees'>, "
-          " 'bees-required': <2342> }", NULL, NULL, &error);
-
-      g_assert_no_error (error);
-
-      tp_base_connection_disconnect_with_dbus_error_vardict (
-          test->service_conn_as_base,
-          "com.example.DomainSpecificError",
-          details,
-          TP_CONNECTION_STATUS_REASON_NETWORK_ERROR);
-      g_variant_unref (details);
-    }
-  else
-    {
-      GVariantDict dict;
+  details = g_variant_parse (G_VARIANT_TYPE_VARDICT,
+      "{ 'debug-message': <'not enough bees'>, "
+      " 'bees-required': <2342> }", NULL, NULL, &error);
 
-      g_variant_dict_init (&dict, NULL);
-      g_variant_dict_insert (&dict, "debug-message", "s", "not enough bees");
-      g_variant_dict_insert (&dict, "bees-required", "i", 2342);
+  g_assert_no_error (error);
 
-      tp_base_connection_disconnect_with_dbus_error_vardict (
-          test->service_conn_as_base,
-          "com.example.DomainSpecificError",
-          g_variant_dict_end (&dict),
-          TP_CONNECTION_STATUS_REASON_NETWORK_ERROR);
-    }
+  tp_base_connection_disconnect_with_dbus_error (
+      test->service_conn_as_base,
+      "com.example.DomainSpecificError",
+      details,
+      TP_CONNECTION_STATUS_REASON_NETWORK_ERROR);
+  g_variant_unref (details);
 
   g_main_loop_run (test->mainloop);
 
@@ -363,8 +346,6 @@ main (int argc,
       test_unregistered_error, teardown);
   g_test_add ("/connection/detailed-error", Test, NULL, setup,
       test_detailed_error, teardown);
-  g_test_add ("/connection/detailed-error-vardict", Test, "variant", setup,
-      test_detailed_error, teardown);
 
   return tp_tests_run_with_bus ();
 }



More information about the telepathy-commits mailing list