[next] telepathy-glib: remove tp_account_get_detailed_error()

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


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

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Tue Feb 18 12:14:05 2014 +0100

remove tp_account_get_detailed_error()

---

 .../telepathy-glib/telepathy-glib-sections.txt     |    1 -
 telepathy-glib/account.c                           |   39 --------------------
 telepathy-glib/account.h                           |    2 -
 tests/dbus/account.c                               |   27 +++++---------
 4 files changed, 9 insertions(+), 60 deletions(-)

diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
index f333b87..917a757 100644
--- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
@@ -4013,7 +4013,6 @@ tp_account_set_connect_automatically_async
 tp_account_set_connect_automatically_finish
 tp_account_get_has_been_online
 tp_account_get_connection_status
-tp_account_get_detailed_error
 tp_account_dup_detailed_error_vardict
 tp_account_get_changing_presence
 tp_account_get_current_presence
diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c
index f22e965..88fa744 100644
--- a/telepathy-glib/account.c
+++ b/telepathy-glib/account.c
@@ -3701,45 +3701,6 @@ tp_account_set_avatar_async (TpAccount *self,
 }
 
 /**
- * tp_account_get_detailed_error: (skip)
- * @self: an account
- * @details: (out) (allow-none) (element-type utf8 GObject.Value) (transfer none):
- *  optionally used to return a map from string to #GValue, which must not be
- *  modified, destroyed or unreffed by the caller
- *
- * If the account's connection is not connected, return the D-Bus error name
- * with which it last disconnected or failed to connect (in particular, this
- * is %TP_ERROR_STR_CANCELLED if it was disconnected by a user request).
- * This is the same as #TpAccount:connection-error.
- *
- * If @details is not %NULL, it will be used to return additional details about
- * the error (the same as #TpAccount:connection-error-details).
- *
- * Otherwise, return %NULL, without altering @details.
- *
- * The returned string and @details may become invalid when the main loop is
- * re-entered or the account is destroyed.
- *
- * Returns: (transfer none) (allow-none): a D-Bus error name, or %NULL.
- *
- * Since: 0.11.7
- */
-const gchar *
-tp_account_get_detailed_error (TpAccount *self,
-    const GHashTable **details)
-{
-  g_return_val_if_fail (TP_IS_ACCOUNT (self), NULL);
-
-  if (self->priv->connection_status == TP_CONNECTION_STATUS_CONNECTED)
-    return NULL;
-
-  if (details != NULL)
-    *details = self->priv->error_details;
-
-  return self->priv->error;
-}
-
-/**
  * tp_account_dup_detailed_error_vardict:
  * @self: an account
  * @details: (out) (allow-none) (transfer full):
diff --git a/telepathy-glib/account.h b/telepathy-glib/account.h
index 6fa1d32..e4e0c49 100644
--- a/telepathy-glib/account.h
+++ b/telepathy-glib/account.h
@@ -190,8 +190,6 @@ gboolean tp_account_get_has_been_online (TpAccount *account);
 TpConnectionStatus tp_account_get_connection_status (TpAccount *account,
     TpConnectionStatusReason *reason);
 
-const gchar *tp_account_get_detailed_error (TpAccount *self,
-    const GHashTable **details);
 _TP_AVAILABLE_IN_0_18
 gchar *tp_account_dup_detailed_error_vardict (TpAccount *self,
     GVariant **details);
diff --git a/tests/dbus/account.c b/tests/dbus/account.c
index d27e9ad..d120238 100644
--- a/tests/dbus/account.c
+++ b/tests/dbus/account.c
@@ -371,7 +371,7 @@ test_prepare_success (Test *test,
   TpConnectionStatusReason reason;
   gchar *status = NULL;
   gchar *message = NULL;
-  const GHashTable *details = GUINT_TO_POINTER (666);
+  GVariant *details = GUINT_TO_POINTER (666);
   GStrv strv;
   const gchar * const *cstrv;
   GVariant *variant;
@@ -413,11 +413,11 @@ test_prepare_success (Test *test,
   g_assert_cmpint (reason, ==, TP_CONNECTION_STATUS_REASON_REQUESTED);
   assert_uintprop (test->account, "connection-status-reason",
       TP_CONNECTION_STATUS_REASON_REQUESTED);
-  g_assert_cmpstr (tp_account_get_detailed_error (test->account, NULL), ==,
-      NULL);
+  g_assert_cmpstr (tp_account_dup_detailed_error_vardict (test->account, NULL),
+      ==, NULL);
   assert_strprop (test->account, "connection-error", NULL);
-  g_assert_cmpstr (tp_account_get_detailed_error (test->account, &details), ==,
-      NULL);
+  g_assert_cmpstr (tp_account_dup_detailed_error_vardict (
+        test->account, &details), ==, NULL);
   /* this is documented to be untouched */
   g_assert_cmpuint (GPOINTER_TO_UINT (details), ==, 666);
 
@@ -766,8 +766,8 @@ test_connection (Test *test,
   g_assert_cmpstr (tp_proxy_get_object_path (conn), ==, conn1_path);
   g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 1);
 
-  g_assert_cmpstr (tp_account_get_detailed_error (test->account, NULL), ==,
-      TP_ERROR_STR_CANCELLED);
+  g_assert_cmpstr (tp_account_dup_detailed_error_vardict (test->account, NULL),
+      ==, TP_ERROR_STR_CANCELLED);
 
   /* a no-op "change" */
 
@@ -815,8 +815,8 @@ test_connection (Test *test,
   conn = tp_account_get_connection (test->account);
   g_assert (conn == NULL);
 
-  g_assert_cmpstr (tp_account_get_detailed_error (test->account, NULL), ==,
-      TP_ERROR_STR_ENCRYPTION_ERROR);
+  g_assert_cmpstr (tp_account_dup_detailed_error_vardict (test->account, NULL),
+      ==, TP_ERROR_STR_ENCRYPTION_ERROR);
 
   /* another connection */
 
@@ -849,15 +849,6 @@ test_connection (Test *test,
   g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 1);
   g_assert_cmpuint (test_get_times_notified (test, "connection-error"), ==, 1);
 
-  g_assert_cmpstr (tp_account_get_detailed_error (test->account,
-      (const GHashTable **) &details), ==,
-      "org.debian.packages.OpenSSL.NotRandomEnough");
-  g_assert_cmpuint (tp_asv_size (details), >=, 2);
-  g_assert_cmpstr (tp_asv_get_string (details, "debug-message"), ==,
-      "shiiiiii-");
-  g_assert_cmpuint (tp_asv_get_uint32 (details, "bits-of-entropy", NULL), ==,
-      15);
-
   s = tp_account_dup_detailed_error_vardict (test->account, &details_v);
   g_assert_cmpstr (s, ==, "org.debian.packages.OpenSSL.NotRandomEnough");
   g_free (s);



More information about the telepathy-commits mailing list