diff options
author | Sarfraaz Ahmed <asarfraaz@novell.com> | 2005-08-02 20:04:56 +0800 |
---|---|---|
committer | Ahmed Sarfraaz <sarfraaz@src.gnome.org> | 2005-08-02 20:04:56 +0800 |
commit | 9ec2d0dd087d7842e0a3c262fcb89061751892b9 (patch) | |
tree | 9b6ee40302c02d7293ffa3f1a7c61f4a583d9386 /plugins/exchange-operations/exchange-folder-permission.c | |
parent | 7d7df9d581ec287e5a4598507a0bbe64b1669b01 (diff) | |
download | gsoc2013-evolution-9ec2d0dd087d7842e0a3c262fcb89061751892b9.tar.gz gsoc2013-evolution-9ec2d0dd087d7842e0a3c262fcb89061751892b9.tar.zst gsoc2013-evolution-9ec2d0dd087d7842e0a3c262fcb89061751892b9.zip |
Check for NULL target Similar Similar Similar
2005-08-02 Sarfraaz Ahmed <asarfraaz@novell.com>
* exchange-calendar.c : Check for NULL target
* exchange-contacts.c : Similar
* exchange-folder-permission.c : Similar
* exchange-folder.c : Similar
svn path=/trunk/; revision=29955
Diffstat (limited to 'plugins/exchange-operations/exchange-folder-permission.c')
-rw-r--r-- | plugins/exchange-operations/exchange-folder-permission.c | 59 |
1 files changed, 18 insertions, 41 deletions
diff --git a/plugins/exchange-operations/exchange-folder-permission.c b/plugins/exchange-operations/exchange-folder-permission.c index 78d190c5a4..11beb9e080 100644 --- a/plugins/exchange-operations/exchange-folder-permission.c +++ b/plugins/exchange-operations/exchange-folder-permission.c @@ -70,25 +70,22 @@ org_gnome_exchange_calendar_permissions (EPlugin *ep, ECalPopupTargetSource *tar int i = 0; static int first =0; ExchangeAccount *account = NULL; - EFolder *folder = NULL; ESource *source = NULL; gchar *uri = NULL; - source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector)); - uri = (gchar *) e_source_get_uri (source); - - if (! g_strrstr (uri, "exchange://")) { - return ; - } - account = exchange_operations_get_exchange_account (); if (!account) return; - folder = exchange_account_get_folder (account, uri); + source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector)); + uri = (gchar *) e_source_get_uri (source); - if (!folder) + if (uri && ! g_strrstr (uri, "exchange://")) { + return; + } + + if (!exchange_account_get_folder (account, uri)) return; selected_exchange_folder_uri = uri; @@ -114,28 +111,22 @@ org_gnome_exchange_addressbook_permissions (EPlugin *ep, EABPopupTargetSource *t int i = 0; static int first =0; ExchangeAccount *account = NULL; - EFolder *folder = NULL; ESource *source = NULL; gchar *uri = NULL; - source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector)); - uri = (gchar *) e_source_get_uri (source); - - if (! g_strrstr (uri, "exchange://")) { - return ; - } - account = exchange_operations_get_exchange_account (); if (!account) return; + source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector)); + uri = (gchar *) e_source_get_uri (source); - folder = exchange_account_get_folder (account, uri); + if (!g_strrstr (uri, "exchange://")) + return; - if (!folder) { + if (!exchange_account_get_folder (account, uri)) return; - } selected_exchange_folder_uri = uri; @@ -152,29 +143,18 @@ org_gnome_exchange_addressbook_permissions (EPlugin *ep, EABPopupTargetSource *t } void -org_gnome_exchange_folder_permissions (EPlugin *ep, EMPopupTargetFolder *t) +org_gnome_exchange_folder_permissions (EPlugin *ep, EMPopupTargetFolder *target) { GSList *menus = NULL; int i = 0; static int first =0; - ExchangeAccount *account = NULL; - EFolder *folder = NULL; + ExchangeAccount *account = exchange_operations_get_exchange_account (); - if (! g_strrstr (t->uri, "exchange://")) + if (!account || ! g_strrstr (target->uri, "exchange://") || + !exchange_account_get_folder (account, target->uri)) return ; - account = exchange_operations_get_exchange_account (); - - if (!account) - return; - - folder = exchange_account_get_folder (account, t->uri); - - - if (!folder) - return; - - selected_exchange_folder_uri = t->uri; + selected_exchange_folder_uri = target->uri; /* for translation*/ if (!first) { popup_items[0].label = _(popup_items[0].label); @@ -184,7 +164,7 @@ org_gnome_exchange_folder_permissions (EPlugin *ep, EMPopupTargetFolder *t) for (i = 0; i < sizeof (popup_items) / sizeof (popup_items[0]); i++) menus = g_slist_prepend (menus, &popup_items[i]); - e_popup_add_items (t->target.popup, menus, NULL, popup_free, NULL); + e_popup_add_items (target->target.popup, menus, NULL, popup_free, NULL); } @@ -211,9 +191,6 @@ org_gnome_exchange_menu_folder_permissions (EPlugin *ep, EMMenuTargetSelect *tar ExchangeAccount *account = NULL; EFolder *folder = NULL; - if (target == NULL) - return; - account = exchange_operations_get_exchange_account (); if (!account) |