From 3b5cac93a4d81e187edca49db15816a800cd5e82 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 30 Oct 2007 10:56:04 +0000 Subject: [PATCH] * do some parameter checks for is_busy / set_busy, and code style cleanup pmo-trunk-r3599 --- src/modest-account-mgr.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/modest-account-mgr.c b/src/modest-account-mgr.c index 2a309c4..d37c498 100644 --- a/src/modest-account-mgr.c +++ b/src/modest-account-mgr.c @@ -1245,9 +1245,13 @@ modest_account_mgr_set_account_busy(ModestAccountMgr* self, const gchar* account_name, gboolean busy) { - ModestAccountMgrPrivate* priv = MODEST_ACCOUNT_MGR_GET_PRIVATE (self); - if (busy) - { + ModestAccountMgrPrivate* priv; + + g_return_if_fail (MODEST_IS_ACCOUNT_MGR(self)); + g_return_if_fail (account_name); + + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE (self); + if (busy) { GSList *account_names = modest_account_mgr_account_names (self, TRUE); GSList* account = g_slist_find_custom(account_names, account_name, (GCompareFunc) compare_account_name); @@ -1273,11 +1277,17 @@ modest_account_mgr_set_account_busy(ModestAccountMgr* self, } gboolean -modest_account_mgr_account_is_busy(ModestAccountMgr* self, const gchar* account_name) +modest_account_mgr_account_is_busy (ModestAccountMgr* self, const gchar* account_name) { - ModestAccountMgrPrivate* priv = MODEST_ACCOUNT_MGR_GET_PRIVATE (self); + ModestAccountMgrPrivate* priv; + + g_return_val_if_fail (MODEST_IS_ACCOUNT_MGR(self), FALSE); + g_return_val_if_fail (account_name, FALSE); + + priv = MODEST_ACCOUNT_MGR_GET_PRIVATE (self); + return (g_slist_find_custom(priv->busy_accounts, account_name, (GCompareFunc) compare_account_name) - != NULL); + != NULL); } void -- 1.7.9.5