[telepathy-glib/master] TpAccountManager: Don't use G_N_ELEMENTS() + fix typo.

David Laban david.laban at collabora.co.uk
Tue Nov 17 11:28:40 PST 2009


Copy-paste of a previous commit.
---
 telepathy-glib/account-manager.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/telepathy-glib/account-manager.c b/telepathy-glib/account-manager.c
index a234834..2ca5640 100644
--- a/telepathy-glib/account-manager.c
+++ b/telepathy-glib/account-manager.c
@@ -152,7 +152,7 @@ tp_account_manager_get_feature_quark_core (void)
 static const GQuark *
 _tp_account_manager_get_known_features (void)
 {
-  static GQuark features[1] = { 0 };
+  static GQuark features[2] = { 0, 0 };
 
   if (G_UNLIKELY (features[0] == 0))
     {
@@ -609,7 +609,7 @@ _tp_account_manager_constructed (GObject *object)
   known_features = _tp_account_manager_get_known_features ();
 
   /* Fill features list. */
-  for (i = 0; i < G_N_ELEMENTS (known_features); i++)
+  for (i = 0; known_features[i] != 0; i++)
     {
       TpAccountManagerFeature *feature;
       feature = g_slice_new0 (TpAccountManagerFeature);
@@ -1406,9 +1406,10 @@ tp_account_manager_prepare_async (TpAccountManager *manager,
   for (f = features; f != NULL && *f != 0; f++)
     {
       /* Only add features to requested which exist on this object and are not
-       * already in the list. */
+       * already in the list.
+       */
       if (_tp_account_manager_get_feature (manager, *f) != NULL
-          && _tp_account_manager_feature_in_array (*f, priv->requested_features))
+          && !_tp_account_manager_feature_in_array (*f, priv->requested_features))
         g_array_append_val (priv->requested_features, *f);
     }
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list