[telepathy-gabble/master] gabble_connection_get_handle_capabilities: re-indent

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Aug 24 08:31:48 PDT 2009


"if for {" is an anti-pattern; "if { for {" is much clearer.
---
 src/connection.c |   50 ++++++++++++++++++++++++++------------------------
 1 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index 64a10b9..b00d1e7 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -2670,30 +2670,32 @@ gabble_connection_get_handle_capabilities (GabbleConnection *self,
     pres = gabble_presence_cache_get (self->presence_cache, handle);
 
   if (NULL != pres)
-    for (ccd = capabilities_conversions; NULL != ccd->iface; ccd++)
-      {
-        typeflags = ccd->c2tf_fn (pres->caps);
-
-        if (typeflags)
-          {
-            GValue monster = {0, };
-
-            g_value_init (&monster, TP_STRUCT_TYPE_CONTACT_CAPABILITY);
-            g_value_take_boxed (&monster,
-                dbus_g_type_specialized_construct (
-                  TP_STRUCT_TYPE_CONTACT_CAPABILITY));
-
-            dbus_g_type_struct_set (&monster,
-                0, handle,
-                1, ccd->iface,
-                2, TP_CONNECTION_CAPABILITY_FLAG_CREATE |
-                    TP_CONNECTION_CAPABILITY_FLAG_INVITE,
-                3, typeflags,
-                G_MAXUINT);
-
-            g_ptr_array_add (arr, g_value_get_boxed (&monster));
-          }
-      }
+    {
+      for (ccd = capabilities_conversions; NULL != ccd->iface; ccd++)
+        {
+          typeflags = ccd->c2tf_fn (pres->caps);
+
+          if (typeflags)
+            {
+              GValue monster = {0, };
+
+              g_value_init (&monster, TP_STRUCT_TYPE_CONTACT_CAPABILITY);
+              g_value_take_boxed (&monster,
+                  dbus_g_type_specialized_construct (
+                    TP_STRUCT_TYPE_CONTACT_CAPABILITY));
+
+              dbus_g_type_struct_set (&monster,
+                  0, handle,
+                  1, ccd->iface,
+                  2, TP_CONNECTION_CAPABILITY_FLAG_CREATE |
+                      TP_CONNECTION_CAPABILITY_FLAG_INVITE,
+                  3, typeflags,
+                  G_MAXUINT);
+
+              g_ptr_array_add (arr, g_value_get_boxed (&monster));
+            }
+        }
+    }
 
   for (assumed = assumed_caps; NULL != *assumed; assumed++)
     {
-- 
1.5.6.5




More information about the telepathy-commits mailing list