[Pkg-telepathy-commits] [telepathy-glib] 46/111: _tp_protocol_parse_rcc: produce debug output

Simon McVittie smcv at debian.org
Wed Mar 19 18:07:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-glib.

commit a47643a8ca7abf496aeb0c4f936aa995cf8f9ffc
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Wed Oct 30 11:59:22 2013 +0000

    _tp_protocol_parse_rcc: produce debug output
    
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048
    Reviewed-by: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
---
 telepathy-glib/protocol.c | 36 +++++++++++++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/telepathy-glib/protocol.c b/telepathy-glib/protocol.c
index caf78ce..b634a7f 100644
--- a/telepathy-glib/protocol.c
+++ b/telepathy-glib/protocol.c
@@ -1465,16 +1465,30 @@ _tp_protocol_parse_channel_class (GKeyFile *file,
 
       /* keys without a space are reserved */
       if (space == NULL)
-        goto cleanup;
+        {
+          DEBUG ("\t'%s' isn't a fixed property", *key);
+          goto cleanup;
+        }
 
       property = g_strndup (*key, space - *key);
       dbus_type = space + 1;
 
       if (!init_gvalue_from_dbus_sig (dbus_type, v))
-        goto cleanup;
+        {
+          DEBUG ("\tunable to parse D-Bus type '%s' for '%s' in a "
+              ".manager file", dbus_type, property);
+          goto cleanup;
+        }
 
       if (!parse_default_value (v, dbus_type, value, file, group, *key))
-        goto cleanup;
+        {
+          DEBUG ("\tunable to parse '%s' as a value of type '%s' for '%s'",
+              value, dbus_type, property);
+          goto cleanup;
+        }
+
+      DEBUG ("\tfixed: '%s' of type '%s' = '%s'",
+          property, dbus_type, value);
 
       /* transfer ownership to @ret */
       g_hash_table_insert (ret, property, v);
@@ -1500,16 +1514,27 @@ cleanup:
 }
 
 static GValueArray *
-_tp_protocol_parse_rcc (GKeyFile *file,
+_tp_protocol_parse_rcc (const gchar *cm_debug_name,
+    const gchar *protocol_debug_name,
+    GKeyFile *file,
     const gchar *group)
 {
   GHashTable *fixed;
   GStrv allowed;
   GValueArray *ret;
+  guint i;
+
+  DEBUG ("%s/%s: parsing requestable channel class '%s'", cm_debug_name,
+      protocol_debug_name, group);
 
   fixed = _tp_protocol_parse_channel_class (file, group);
   allowed = g_key_file_get_string_list (file, group, "allowed", NULL, NULL);
 
+  for (i = 0; allowed != NULL && allowed[i] != NULL; i++)
+    {
+      DEBUG ("\tallowed: '%s'", allowed[i]);
+    }
+
   ret = tp_value_array_build (2,
       TP_HASH_TYPE_CHANNEL_CLASS, fixed,
       G_TYPE_STRV, allowed,
@@ -1709,7 +1734,8 @@ _tp_protocol_parse_manager_file (GKeyFile *file,
   if (rcc_groups != NULL)
     {
       for (rcc_group = rcc_groups; *rcc_group != NULL; rcc_group++)
-        g_ptr_array_add (rccs, _tp_protocol_parse_rcc (file, *rcc_group));
+        g_ptr_array_add (rccs,
+            _tp_protocol_parse_rcc (cm_debug_name, name, file, *rcc_group));
     }
 
   g_strfreev (rcc_groups);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-glib.git



More information about the Pkg-telepathy-commits mailing list