telepathy-salut: Revert "Use non-deprecated TpIntset APIs"

Will Thompson wjt at kemper.freedesktop.org
Fri Nov 16 08:17:25 PST 2012


Module: telepathy-salut
Branch: master
Commit: 600a3bb495d44a594072f132f4caf3888af41b6a
URL:    http://cgit.freedesktop.org/telepathy/telepathy-salut/commit/?id=600a3bb495d44a594072f132f4caf3888af41b6a

Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Fri Nov 16 14:23:34 2012 +0000

Revert "Use non-deprecated TpIntset APIs"

This reverts commit 9ef6d455d1ea4f48bfe300a1b3c5a89061edc81d.

---

 src/capability-set.c |   35 ++++++++++++++++-------------------
 src/muc-channel.c    |   20 ++++++++++----------
 src/olpc-activity.c  |   10 +++++-----
 3 files changed, 31 insertions(+), 34 deletions(-)

diff --git a/src/capability-set.c b/src/capability-set.c
index bd2a7bb..fe6b730 100644
--- a/src/capability-set.c
+++ b/src/capability-set.c
@@ -426,7 +426,7 @@ void
 gabble_capability_set_update (GabbleCapabilitySet *target,
     const GabbleCapabilitySet *source)
 {
-  TpIntset *ret;
+  TpIntSet *ret;
   g_return_if_fail (target != NULL);
   g_return_if_fail (source != NULL);
 
@@ -586,17 +586,16 @@ gboolean
 gabble_capability_set_has_one (const GabbleCapabilitySet *caps,
     const GabbleCapabilitySet *alternatives)
 {
-  TpIntsetFastIter iter;
-  guint element;
+  TpIntSetIter iter;
 
   g_return_val_if_fail (caps != NULL, FALSE);
   g_return_val_if_fail (alternatives != NULL, FALSE);
 
-  tp_intset_fast_iter_init (&iter, tp_handle_set_peek (alternatives->handles));
+  tp_intset_iter_init (&iter, tp_handle_set_peek (alternatives->handles));
 
-  while (tp_intset_fast_iter_next (&iter, &element))
+  while (tp_intset_iter_next (&iter))
     {
-      if (tp_handle_set_is_member (caps->handles, element))
+      if (tp_handle_set_is_member (caps->handles, iter.element))
         {
           return TRUE;
         }
@@ -610,17 +609,16 @@ gboolean
 gabble_capability_set_at_least (const GabbleCapabilitySet *caps,
     const GabbleCapabilitySet *query)
 {
-  TpIntsetFastIter iter;
-  guint element;
+  TpIntSetIter iter;
 
   g_return_val_if_fail (caps != NULL, FALSE);
   g_return_val_if_fail (query != NULL, FALSE);
 
-  tp_intset_fast_iter_init (&iter, tp_handle_set_peek (query->handles));
+  tp_intset_iter_init (&iter, tp_handle_set_peek (query->handles));
 
-  while (tp_intset_fast_iter_next (&iter, &element))
+  while (tp_intset_iter_next (&iter))
     {
-      if (!tp_handle_set_is_member (caps->handles, element))
+      if (!tp_handle_set_is_member (caps->handles, iter.element))
         {
           return FALSE;
         }
@@ -645,17 +643,16 @@ void
 gabble_capability_set_foreach (const GabbleCapabilitySet *caps,
     GFunc func, gpointer user_data)
 {
-  TpIntsetFastIter iter;
-  guint element;
+  TpIntSetIter iter;
 
   g_return_if_fail (caps != NULL);
   g_return_if_fail (func != NULL);
 
-  tp_intset_fast_iter_init (&iter, tp_handle_set_peek (caps->handles));
+  tp_intset_iter_init (&iter, tp_handle_set_peek (caps->handles));
 
-  while (tp_intset_fast_iter_next (&iter, &element))
+  while (tp_intset_iter_next (&iter))
     {
-      const gchar *var = tp_handle_inspect (feature_handles, element);
+      const gchar *var = tp_handle_inspect (feature_handles, iter.element);
 
       g_return_if_fail (var != NULL);
 
@@ -666,10 +663,10 @@ gabble_capability_set_foreach (const GabbleCapabilitySet *caps,
 
 static void
 append_intset (GString *ret,
-    const TpIntset *cap_ints,
+    const TpIntSet *cap_ints,
     const gchar *indent)
 {
-  TpIntsetFastIter iter;
+  TpIntSetFastIter iter;
   guint element;
 
   tp_intset_fast_iter_init (&iter, cap_ints);
@@ -715,7 +712,7 @@ gabble_capability_set_dump_diff (const GabbleCapabilitySet *old_caps,
     const GabbleCapabilitySet *new_caps,
     const gchar *indent)
 {
-  TpIntset *old_ints, *new_ints, *rem, *add;
+  TpIntSet *old_ints, *new_ints, *rem, *add;
   GString *ret;
 
   g_return_val_if_fail (old_caps != NULL, NULL);
diff --git a/src/muc-channel.c b/src/muc-channel.c
index 38bf002..93caa55 100644
--- a/src/muc-channel.c
+++ b/src/muc-channel.c
@@ -180,8 +180,8 @@ salut_muc_channel_add_self_to_members (SalutMucChannel *self)
   SalutMucChannelPrivate *priv = self->priv;
   TpBaseConnection *base_conn = tp_base_channel_get_connection (
       TP_BASE_CHANNEL (self));
-  TpIntset *empty;
-  TpIntset *add;
+  TpIntSet *empty;
+  TpIntSet *add;
 
   priv->connected = TRUE;
   g_signal_emit (self, signals[READY], 0);
@@ -409,7 +409,7 @@ send_invite_cb (GObject *source_object,
       TP_BASE_CHANNEL (data->self));
   GError *error = NULL;
   TpHandle handle;
-  TpIntset *empty, *removed;
+  TpIntSet *empty, *removed;
 
   if (wocky_porter_send_finish (porter, result, &error))
     /* success */
@@ -492,13 +492,13 @@ salut_muc_channel_add_member (GObject *iface,
   SalutMucChannel *self = SALUT_MUC_CHANNEL (iface);
   TpBaseConnection *base_connection = tp_base_channel_get_connection (
       TP_BASE_CHANNEL (self));
-  TpIntset *empty, *remote_pending;
+  TpIntSet *empty, *remote_pending;
 
   if (handle == base_connection->self_handle)
     {
       /* adding yourself, let's join the muc */
-      TpIntset *empty_;
-      TpIntset *add;
+      TpIntSet *empty_;
+      TpIntSet *add;
       gboolean ret = TRUE;
 
       if (tp_handle_set_is_member (self->group.remote_pending,
@@ -792,8 +792,8 @@ salut_muc_channel_invited (SalutMucChannel *self, TpHandle inviter,
     }
   else
     {
-      TpIntset *empty = tp_intset_new ();
-      TpIntset *local_pending = tp_intset_new ();
+      TpIntSet *empty = tp_intset_new ();
+      TpIntSet *local_pending = tp_intset_new ();
 
       g_assert (stanza != NULL);
 
@@ -836,7 +836,7 @@ salut_muc_channel_add_members (SalutMucChannel *self,
   SalutMucChannelPrivate *priv = self->priv;
   TpBaseConnection *base_conn = tp_base_channel_get_connection (
       TP_BASE_CHANNEL (self));
-  TpIntset *empty, *changes;
+  TpIntSet *empty, *changes;
   guint i;
   SalutContactManager *contact_mgr;
 
@@ -881,7 +881,7 @@ salut_muc_channel_remove_members (SalutMucChannel *self,
       base_chan);
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
       base_connection, TP_HANDLE_TYPE_CONTACT);
-  TpIntset *empty, *changes;
+  TpIntSet *empty, *changes;
   guint i;
 
   empty = tp_intset_new ();
diff --git a/src/olpc-activity.c b/src/olpc-activity.c
index df3f9b5..333c884 100644
--- a/src/olpc-activity.c
+++ b/src/olpc-activity.c
@@ -608,8 +608,8 @@ salut_olpc_activity_revoke_invitations (SalutOlpcActivity *self)
       (TpBaseConnection *) self->connection, TP_HANDLE_TYPE_CONTACT);
   TpHandleRepoIface *room_repo = tp_base_connection_get_handles (
       (TpBaseConnection *) self->connection, TP_HANDLE_TYPE_CONTACT);
-  TpIntsetFastIter iter;
-  guint contact_handle;
+  TpIntSetIter iter = TP_INTSET_ITER_INIT (tp_handle_set_peek (
+        priv->invited));
   SalutContactManager *contact_mgr;
   WockyNode *top_node;
 
@@ -632,14 +632,14 @@ salut_olpc_activity_revoke_invitations (SalutOlpcActivity *self)
       NULL);
   g_assert (contact_mgr != NULL);
 
-  tp_intset_fast_iter_init (&iter, tp_handle_set_peek (priv->invited));
-
   DEBUG ("revoke invitations for activity %s", self->id);
-  while (tp_intset_fast_iter_next (&iter, &contact_handle))
+  while (tp_intset_iter_next (&iter))
     {
+      TpHandle contact_handle;
       SalutContact *contact;
       const gchar *to;
 
+      contact_handle = iter.element;
       contact = salut_contact_manager_get_contact (contact_mgr, contact_handle);
       if (contact == NULL)
         {



More information about the telepathy-commits mailing list