[evolution-mapi] Revert "Avoid e_return_data_book_error_if_fail()."



commit 1740b96fe8e1497934d11cc3ae67eaccf9b58d3a
Author: Milan Crha <mcrha redhat com>
Date:   Tue Apr 2 07:56:51 2013 +0200

    Revert "Avoid e_return_data_book_error_if_fail()."
    
    The macro usage should be replaced, not completely removed.
    
    This reverts commit 2a0af865138886a4ab7bb556970950e99fabca1a.

 src/addressbook/e-book-backend-mapi-contacts.c |   74 ++++++++++++++++++++++++
 src/addressbook/e-book-backend-mapi-gal.c      |    3 +
 src/addressbook/e-book-backend-mapi.c          |    4 +
 3 files changed, 81 insertions(+), 0 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-mapi-contacts.c b/src/addressbook/e-book-backend-mapi-contacts.c
index 7afb719..b2012f4 100644
--- a/src/addressbook/e-book-backend-mapi-contacts.c
+++ b/src/addressbook/e-book-backend-mapi-contacts.c
@@ -395,7 +395,11 @@ ebbm_contacts_remove (EBookBackendMAPI *ebma, GCancellable *cancellable, GError
        EBookBackendMAPIContactsPrivate *priv;
        GError *mapi_error = NULL;
 
+       e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (E_IS_BOOK_BACKEND_MAPI_CONTACTS (ebma), 
E_DATA_BOOK_STATUS_INVALID_ARG);
+
        priv = E_BOOK_BACKEND_MAPI_CONTACTS (ebma)->priv;
+       e_return_data_book_error_if_fail (priv != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 
        if (E_BOOK_BACKEND_MAPI_CLASS (e_book_backend_mapi_contacts_parent_class)->op_remove)
                E_BOOK_BACKEND_MAPI_CLASS (e_book_backend_mapi_contacts_parent_class)->op_remove (ebma, 
cancellable, &mapi_error);
@@ -439,6 +443,7 @@ static void
 ebbm_contacts_create_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable, const GSList *vcards, 
GSList **added_contacts, GError **error)
 {
        EBookBackendMAPIContacts *ebmac;
+       EBookBackendMAPIContactsPrivate *priv;
        EMapiConnection *conn;
        EMapiCreateitemData mcd;
        GError *mapi_error = NULL;
@@ -448,7 +453,16 @@ ebbm_contacts_create_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable
        gchar *id;
        EContact *contact;
 
+       e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (E_IS_BOOK_BACKEND_MAPI_CONTACTS (ebma), 
E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (vcards != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (added_contacts != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
        ebmac = E_BOOK_BACKEND_MAPI_CONTACTS (ebma);
+       e_return_data_book_error_if_fail (ebmac != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
+       priv = ebmac->priv;
+       e_return_data_book_error_if_fail (priv != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 
        if (vcards->next) {
                g_propagate_error (error, EDB_ERROR_EX (NOT_SUPPORTED, _("The backend does not support bulk 
additions")));
@@ -517,13 +531,23 @@ static void
 ebbm_contacts_remove_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable, const GSList *id_list, 
GSList **removed_ids, GError **error)
 {
        EBookBackendMAPIContacts *ebmac;
+       EBookBackendMAPIContactsPrivate *priv;
        EMapiConnection *conn;
        GError *mapi_error = NULL;
        GSList *to_remove;
        const GSList *l;
        mapi_object_t obj_folder;
 
+       e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (E_IS_BOOK_BACKEND_MAPI_CONTACTS (ebma), 
E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (id_list != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (removed_ids != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
        ebmac = E_BOOK_BACKEND_MAPI_CONTACTS (ebma);
+       e_return_data_book_error_if_fail (ebmac != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
+       priv = ebmac->priv;
+       e_return_data_book_error_if_fail (priv != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 
        e_book_backend_mapi_lock_connection (ebma);
 
@@ -581,13 +605,23 @@ static void
 ebbm_contacts_modify_contacts (EBookBackendMAPI *ebma, GCancellable *cancellable, const GSList *vcards, 
GSList **modified_contacts, GError **error)
 {
        EBookBackendMAPIContacts *ebmac;
+       EBookBackendMAPIContactsPrivate *priv;
        EMapiConnection *conn;
        EMapiCreateitemData mcd;
        EContact *contact;
        GError *mapi_error = NULL;
        mapi_id_t mid;
 
+       e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (E_IS_BOOK_BACKEND_MAPI_CONTACTS (ebma), 
E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (vcards != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (modified_contacts != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
        ebmac = E_BOOK_BACKEND_MAPI_CONTACTS (ebma);
+       e_return_data_book_error_if_fail (ebmac != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
+       priv = ebmac->priv;
+       e_return_data_book_error_if_fail (priv != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 
        if (vcards->next != NULL) {
                g_propagate_error (error, EDB_ERROR_EX (NOT_SUPPORTED, _("The backend does not support bulk 
modifications")));
@@ -654,6 +688,7 @@ static void
 ebbm_contacts_get_contact (EBookBackendMAPI *ebma, GCancellable *cancellable, const gchar *id, gchar 
**vcard, GError **error)
 {
        EBookBackendMAPIContacts *ebmac;
+       EBookBackendMAPIContactsPrivate *priv;
        EMapiConnection *conn;
        mapi_id_t mid;
        mapi_object_t obj_folder;
@@ -661,7 +696,16 @@ ebbm_contacts_get_contact (EBookBackendMAPI *ebma, GCancellable *cancellable, co
        gboolean status, has_obj_folder;
        GError *mapi_error = NULL;
 
+       e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (E_IS_BOOK_BACKEND_MAPI_CONTACTS (ebma), 
E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (id != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (vcard != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
        ebmac = E_BOOK_BACKEND_MAPI_CONTACTS (ebma);
+       e_return_data_book_error_if_fail (ebmac != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
+       priv = ebmac->priv;
+       e_return_data_book_error_if_fail (priv != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 
        if (E_BOOK_BACKEND_MAPI_CLASS (e_book_backend_mapi_contacts_parent_class)->op_get_contact)
                E_BOOK_BACKEND_MAPI_CLASS (e_book_backend_mapi_contacts_parent_class)->op_get_contact (ebma, 
cancellable, id, vcard, &mapi_error);
@@ -733,6 +777,7 @@ static void
 ebbm_contacts_get_contact_list (EBookBackendMAPI *ebma, GCancellable *cancellable, const gchar *query, 
GSList **vCards, GError **error)
 {
        EBookBackendMAPIContacts *ebmac;
+       EBookBackendMAPIContactsPrivate *priv;
        EMapiConnection *conn;
        GError *mapi_error = NULL;
        gboolean status;
@@ -740,7 +785,16 @@ ebbm_contacts_get_contact_list (EBookBackendMAPI *ebma, GCancellable *cancellabl
        GSList *mids = NULL;
        struct TransferContactsData tcd = { 0 };
 
+       e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (E_IS_BOOK_BACKEND_MAPI_CONTACTS (ebma), 
E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (query != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (vCards != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
        ebmac = E_BOOK_BACKEND_MAPI_CONTACTS (ebma);
+       e_return_data_book_error_if_fail (ebmac != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
+       priv = ebmac->priv;
+       e_return_data_book_error_if_fail (priv != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 
        if (E_BOOK_BACKEND_MAPI_CLASS (e_book_backend_mapi_contacts_parent_class)->op_get_contact_list)
                E_BOOK_BACKEND_MAPI_CLASS (e_book_backend_mapi_contacts_parent_class)->op_get_contact_list 
(ebma, cancellable, query, vCards, &mapi_error);
@@ -829,7 +883,12 @@ ebbm_contacts_get_contacts_count (EBookBackendMAPI *ebma,
        mapi_object_t obj_folder;
        GError *mapi_error = NULL;
 
+       e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (obj_total != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
        ebmac = E_BOOK_BACKEND_MAPI_CONTACTS (ebma);
+       e_return_data_book_error_if_fail (ebmac != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (ebmac->priv != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 
        e_book_backend_mapi_lock_connection (ebma);
 
@@ -884,7 +943,14 @@ ebbm_contacts_list_known_uids (EBookBackendMAPI *ebma,
        mapi_object_t obj_folder;
        GError *mapi_error = NULL;
 
+       e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (E_IS_BOOK_BACKEND_MAPI_CONTACTS (ebma), 
E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (lku != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (lku->uid_to_rev != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
        ebmac = E_BOOK_BACKEND_MAPI_CONTACTS (ebma);
+       e_return_data_book_error_if_fail (ebmac != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (ebmac->priv != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 
        e_book_backend_mapi_lock_connection (ebma);
 
@@ -930,13 +996,21 @@ ebbm_contacts_transfer_contacts (EBookBackendMAPI *ebma,
                                 GError **error)
 {
        EBookBackendMAPIContacts *ebmac;
+       EBookBackendMAPIContactsPrivate *priv;
        EMapiConnection *conn;
        struct TransferContactsData tcd = { 0 };
        mapi_object_t obj_folder;
        gboolean status;
        GError *mapi_error = NULL;
 
+       e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (E_IS_BOOK_BACKEND_MAPI_CONTACTS (ebma), 
E_DATA_BOOK_STATUS_INVALID_ARG);
+
        ebmac = E_BOOK_BACKEND_MAPI_CONTACTS (ebma);
+       e_return_data_book_error_if_fail (ebmac != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
+       priv = ebmac->priv;
+       e_return_data_book_error_if_fail (priv != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
 
        e_book_backend_mapi_lock_connection (ebma);
 
diff --git a/src/addressbook/e-book-backend-mapi-gal.c b/src/addressbook/e-book-backend-mapi-gal.c
index 416bf8b..c1b8166 100644
--- a/src/addressbook/e-book-backend-mapi-gal.c
+++ b/src/addressbook/e-book-backend-mapi-gal.c
@@ -246,6 +246,9 @@ ebbm_gal_get_contacts_count (EBookBackendMAPI *ebma,
        EMapiConnection *conn;
        GError *mapi_error = NULL;
 
+       e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (obj_total != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
        e_book_backend_mapi_lock_connection (ebma);
 
        conn = e_book_backend_mapi_get_connection (ebma, cancellable, &mapi_error);
diff --git a/src/addressbook/e-book-backend-mapi.c b/src/addressbook/e-book-backend-mapi.c
index f42ea30..00cc669 100644
--- a/src/addressbook/e-book-backend-mapi.c
+++ b/src/addressbook/e-book-backend-mapi.c
@@ -551,6 +551,10 @@ ebbm_remove (EBookBackendMAPI *ebma, GCancellable *cancellable, GError **error)
 {
        EBookBackendMAPIPrivate *priv;
 
+       e_return_data_book_error_if_fail (ebma != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (E_IS_BOOK_BACKEND_MAPI (ebma), E_DATA_BOOK_STATUS_INVALID_ARG);
+       e_return_data_book_error_if_fail (ebma->priv != NULL, E_DATA_BOOK_STATUS_INVALID_ARG);
+
        priv = ebma->priv;
 
        if (!priv->book_uid)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]