aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2006-08-21 23:51:11 +0800
committerAndre Klapper <aklapper@src.gnome.org>2006-08-21 23:51:11 +0800
commitb70c1439bf9a941c67831aecf4544f11b1834e68 (patch)
treed9ce1243d6f3b3fdf691f7f656a7ed5e8b2a7a16 /plugins
parentfe0def566cd68e80fc6f51fd8ac3725d14464cbc (diff)
downloadgsoc2013-evolution-b70c1439bf9a941c67831aecf4544f11b1834e68.tar.gz
gsoc2013-evolution-b70c1439bf9a941c67831aecf4544f11b1834e68.tar.zst
gsoc2013-evolution-b70c1439bf9a941c67831aecf4544f11b1834e68.zip
"Disable" did not work for "On This Computer" - fixes bug 350901.
2006-08-21 Matthew Barnes <mbarnes@redhat.com> * mail-account-disable.c: "Disable" did not work for "On This Computer" - fixes bug 350901. svn path=/trunk/; revision=32616
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mail-account-disable/ChangeLog5
-rw-r--r--plugins/mail-account-disable/mail-account-disable.c41
2 files changed, 24 insertions, 22 deletions
diff --git a/plugins/mail-account-disable/ChangeLog b/plugins/mail-account-disable/ChangeLog
index 98bc5e3d61..15821d8513 100644
--- a/plugins/mail-account-disable/ChangeLog
+++ b/plugins/mail-account-disable/ChangeLog
@@ -1,3 +1,8 @@
+2006-08-21 Matthew Barnes <mbarnes@redhat.com>
+
+ * mail-account-disable.c:
+ "Disable" did not work for "On This Computer" - fixes bug 350901.
+
2006-01-06 Simon Zheng <simon.zheng@sun.com>
* mail-account-disable.c:
diff --git a/plugins/mail-account-disable/mail-account-disable.c b/plugins/mail-account-disable/mail-account-disable.c
index 0967abaa48..aea7035a6e 100644
--- a/plugins/mail-account-disable/mail-account-disable.c
+++ b/plugins/mail-account-disable/mail-account-disable.c
@@ -56,28 +56,24 @@ popup_free (EPopup *ep, GSList *items, void *data)
void
mail_account_disable (EPopup *ep, EPopupItem *p, void *data)
{
- char *uri = data;
- EAccount *account;
-
- account = mail_config_get_account_by_source_url (uri);
-
- if (account) {
- MailComponent *component = mail_component_peek ();
-
- if (mail_config_has_proxies(account))
- mail_config_remove_account_proxies (account);
-
- account->enabled = !account->enabled;
- e_account_list_change(mail_config_get_accounts(), account);
- mail_component_remove_store_by_uri (component, account->source->url);
+ MailComponent *component;
+ EAccount *account = data;
- if (account->parent_uid)
- mail_config_remove_account (account);
+ g_assert (account != NULL);
- mail_config_save_accounts();
- }
+ component = mail_component_peek ();
- return ;
+ if (mail_config_has_proxies (account))
+ mail_config_remove_account_proxies (account);
+
+ account->enabled = !account->enabled;
+ e_account_list_change (mail_config_get_accounts (), account);
+ mail_component_remove_store_by_uri (component, account->source->url);
+
+ if (account->parent_uid)
+ mail_config_remove_account (account);
+
+ mail_config_save_accounts();
}
void
@@ -88,6 +84,9 @@ org_gnome_create_mail_account_disable (EPlugin *ep, EMPopupTargetFolder *t)
account = mail_config_get_account_by_source_url (t->uri);
+ if (account == NULL)
+ return;
+
if (g_strrstr (t->uri,"groupwise://") && account->parent_uid) {
popup_items[PROXY_LOGOUT].label = _(popup_items [PROXY_LOGOUT].label);
menus = g_slist_prepend (menus, &popup_items [PROXY_LOGOUT]);
@@ -97,8 +96,6 @@ org_gnome_create_mail_account_disable (EPlugin *ep, EMPopupTargetFolder *t)
menus = g_slist_prepend (menus, &popup_items [ACCOUNT_DISABLE]);
}
- e_popup_add_items (t->target.popup, menus, NULL, popup_free, t->uri);
-
- return;
+ e_popup_add_items (t->target.popup, menus, NULL, popup_free, account);
}