]> git.0d.be Git - empathy.git/commitdiff
tp-contact-factory: remove unused methods
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 7 May 2012 09:54:54 +0000 (11:54 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 8 May 2012 07:13:07 +0000 (09:13 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=675597

libempathy/empathy-tp-contact-factory.c
libempathy/empathy-tp-contact-factory.h

index 111e3190a34b38e38236a067a7761f80e2f345a9..63a1cedeb860a07236fad33b06d363914d96300c 100644 (file)
@@ -36,8 +36,6 @@ static TpContactFeature contact_features[] = {
 };
 
 typedef union {
-       EmpathyTpContactFactoryContactsByIdCb ids_cb;
-       EmpathyTpContactFactoryContactsByHandleCb handles_cb;
        EmpathyTpContactFactoryContactCb contact_cb;
 } GetContactsCb;
 
@@ -61,89 +59,6 @@ get_contacts_data_free (gpointer user_data)
        g_slice_free (GetContactsData, data);
 }
 
-static EmpathyContact **
-contacts_array_new (guint n_contacts,
-                   TpContact * const * contacts)
-{
-       EmpathyContact **ret;
-       guint            i;
-
-       ret = g_new0 (EmpathyContact *, n_contacts);
-       for (i = 0; i < n_contacts; i++) {
-               ret[i] = empathy_contact_dup_from_tp_contact (contacts[i]);
-       }
-
-       return ret;
-}
-
-static void
-contacts_array_free (guint            n_contacts,
-                    EmpathyContact **contacts)
-{
-       guint i;
-
-       for (i = 0; i < n_contacts; i++) {
-               g_object_unref (contacts[i]);
-       }
-       g_free (contacts);
-}
-
-static void
-get_contacts_by_id_cb (TpConnection *connection,
-                      guint n_contacts,
-                      TpContact * const *contacts,
-                      const gchar * const *requested_ids,
-                      GHashTable *failed_id_errors,
-                      const GError *error,
-                      gpointer user_data,
-                      GObject *weak_object)
-{
-       GetContactsData *data = user_data;
-       EmpathyContact **empathy_contacts;
-
-       empathy_contacts = contacts_array_new (n_contacts, contacts);
-       if (data->callback.ids_cb) {
-               data->callback.ids_cb (data->connection,
-                                      n_contacts, empathy_contacts,
-                                      requested_ids,
-                                      failed_id_errors,
-                                      error,
-                                      data->user_data, weak_object);
-       }
-
-       contacts_array_free (n_contacts, empathy_contacts);
-}
-
-/* The callback is NOT given a reference to the EmpathyContact objects */
-void
-empathy_tp_contact_factory_get_from_ids (TpConnection            *connection,
-                                        guint                    n_ids,
-                                        const gchar * const     *ids,
-                                        EmpathyTpContactFactoryContactsByIdCb callback,
-                                        gpointer                 user_data,
-                                        GDestroyNotify           destroy,
-                                        GObject                 *weak_object)
-{
-       GetContactsData *data;
-
-       g_return_if_fail (TP_IS_CONNECTION (connection));
-       g_return_if_fail (ids != NULL);
-
-       data = g_slice_new (GetContactsData);
-       data->callback.ids_cb = callback;
-       data->user_data = user_data;
-       data->destroy = destroy;
-       data->connection = g_object_ref (connection);
-       tp_connection_get_contacts_by_id (connection,
-                                         n_ids, ids,
-                                         G_N_ELEMENTS (contact_features),
-                                         contact_features,
-                                         get_contacts_by_id_cb,
-                                         data,
-                                         (GDestroyNotify) get_contacts_data_free,
-                                         weak_object);
-}
-
 static void
 get_contact_by_id_cb (TpConnection *connection,
                      guint n_contacts,
@@ -213,66 +128,6 @@ empathy_tp_contact_factory_get_from_id (TpConnection            *connection,
                                          weak_object);
 }
 
-static void
-get_contacts_by_handle_cb (TpConnection *connection,
-                          guint n_contacts,
-                          TpContact * const *contacts,
-                          guint n_failed,
-                          const TpHandle *failed,
-                          const GError *error,
-                          gpointer user_data,
-                          GObject *weak_object)
-{
-       GetContactsData *data = user_data;
-       EmpathyContact **empathy_contacts;
-
-       empathy_contacts = contacts_array_new (n_contacts, contacts);
-       if (data->callback.handles_cb) {
-               data->callback.handles_cb (data->connection,
-                                          n_contacts, empathy_contacts,
-                                          n_failed, failed,
-                                          error,
-                                          data->user_data, weak_object);
-       }
-
-       contacts_array_free (n_contacts, empathy_contacts);
-}
-
-/* The callback is NOT given a reference to the EmpathyContact objects */
-void
-empathy_tp_contact_factory_get_from_handles (TpConnection *connection,
-                                            guint n_handles,
-                                            const TpHandle *handles,
-                                            EmpathyTpContactFactoryContactsByHandleCb callback,
-                                            gpointer                 user_data,
-                                            GDestroyNotify           destroy,
-                                            GObject                 *weak_object)
-{
-       GetContactsData *data;
-
-       if (n_handles == 0) {
-               callback (connection, 0, NULL, 0, NULL, NULL, user_data, weak_object);
-               return;
-       }
-
-       g_return_if_fail (TP_IS_CONNECTION (connection));
-       g_return_if_fail (handles != NULL);
-
-       data = g_slice_new (GetContactsData);
-       data->callback.handles_cb = callback;
-       data->user_data = user_data;
-       data->destroy = destroy;
-       data->connection = g_object_ref (connection);
-       tp_connection_get_contacts_by_handle (connection,
-                                             n_handles, handles,
-                                             G_N_ELEMENTS (contact_features),
-                                             contact_features,
-                                             get_contacts_by_handle_cb,
-                                             data,
-                                             (GDestroyNotify) get_contacts_data_free,
-                                             weak_object);
-}
-
 /* The callback is NOT given a reference to the EmpathyContact objects */
 static void
 get_contact_by_handle_cb (TpConnection *connection,
index 29146cb32d07d4ebecb8253a24f2e654d8e0a691..20d699a3eb49e51d67baa4ad9d84d6807293773a 100644 (file)
 
 G_BEGIN_DECLS
 
-typedef void (*EmpathyTpContactFactoryContactsByIdCb) (TpConnection            *connection,
-                                                      guint                    n_contacts,
-                                                      EmpathyContact * const * contacts,
-                                                      const gchar * const *    requested_ids,
-                                                      GHashTable              *failed_id_errors,
-                                                      const GError            *error,
-                                                      gpointer                 user_data,
-                                                      GObject                 *weak_object);
-
-typedef void (*EmpathyTpContactFactoryContactsByHandleCb) (TpConnection            *connection,
-                                                          guint                    n_contacts,
-                                                          EmpathyContact * const * contacts,
-                                                           guint                    n_failed,
-                                                           const TpHandle          *failed,
-                                                           const GError            *error,
-                                                          gpointer                 user_data,
-                                                          GObject                 *weak_object);
-
 typedef void (*EmpathyTpContactFactoryContactCb) (TpConnection            *connection,
                                                  EmpathyContact          *contact,
                                                  const GError            *error,
                                                  gpointer                 user_data,
                                                  GObject                 *weak_object);
 
-void                     empathy_tp_contact_factory_get_from_ids     (TpConnection            *connection,
-                                                                     guint                    n_ids,
-                                                                     const gchar * const     *ids,
-                                                                     EmpathyTpContactFactoryContactsByIdCb callback,
-                                                                     gpointer                 user_data,
-                                                                     GDestroyNotify           destroy,
-                                                                     GObject                 *weak_object);
-void                     empathy_tp_contact_factory_get_from_handles (TpConnection            *connection,
-                                                                     guint                    n_handles,
-                                                                     const TpHandle          *handles,
-                                                                     EmpathyTpContactFactoryContactsByHandleCb callback,
-                                                                     gpointer                 user_data,
-                                                                     GDestroyNotify           destroy,
-                                                                     GObject                 *weak_object);
 void                     empathy_tp_contact_factory_get_from_id      (TpConnection            *connection,
                                                                      const gchar             *id,
                                                                      EmpathyTpContactFactoryContactCb callback,