aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorHarry Lu <harry.lu@sun.com>2005-07-27 17:12:38 +0800
committerHarry Lu <haip@src.gnome.org>2005-07-27 17:12:38 +0800
commit514e598c0a19acb718a68c20e89585a9bc7e7566 (patch)
tree1145d3ca5ce40ca82c1934215d5c73af396b43af /plugins
parent8bbd18d3cffb3fcf2ede8c881f22964434f78eb9 (diff)
downloadgsoc2013-evolution-514e598c0a19acb718a68c20e89585a9bc7e7566.tar.gz
gsoc2013-evolution-514e598c0a19acb718a68c20e89585a9bc7e7566.tar.zst
gsoc2013-evolution-514e598c0a19acb718a68c20e89585a9bc7e7566.zip
Only show the unsubscribe menu if it is an exchange folder.
2005-07-27 Harry Lu <harry.lu@sun.com> Only show the unsubscribe menu if it is an exchange folder. * exchange-folder.c: (org_gnome_exchange_check_address_book_subscribed), (org_gnome_exchange_check_subscribed): svn path=/trunk/; revision=29898
Diffstat (limited to 'plugins')
-rw-r--r--plugins/exchange-operations/ChangeLog7
-rw-r--r--plugins/exchange-operations/exchange-folder.c18
2 files changed, 23 insertions, 2 deletions
diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog
index a35b2703d0..017ea5aa20 100644
--- a/plugins/exchange-operations/ChangeLog
+++ b/plugins/exchange-operations/ChangeLog
@@ -1,3 +1,10 @@
+2005-07-27 Harry Lu <harry.lu@sun.com>
+
+ Only show the unsubscribe menu if it is an exchange folder.
+ * exchange-folder.c:
+ (org_gnome_exchange_check_address_book_subscribed),
+ (org_gnome_exchange_check_subscribed):
+
2005-07-25 Shakti Sen <shprasad@novell.com>
* org-gnome-exchange-operations.eplug.in: Fixed a small typo.
diff --git a/plugins/exchange-operations/exchange-folder.c b/plugins/exchange-operations/exchange-folder.c
index 4c20c54136..139ead0fa8 100644
--- a/plugins/exchange-operations/exchange-folder.c
+++ b/plugins/exchange-operations/exchange-folder.c
@@ -124,6 +124,7 @@ org_gnome_exchange_check_address_book_subscribed (EPlugin *ep, EABPopupTargetSou
gchar *path = NULL;
char *sub_folder = NULL;
ExchangeAccount *account = NULL;
+ ESourceGroup *group;
account = exchange_operations_get_exchange_account ();
@@ -131,12 +132,18 @@ org_gnome_exchange_check_address_book_subscribed (EPlugin *ep, EABPopupTargetSou
return;
source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector));
+ group = e_source_peek_group (source);
+ if (!group || strcmp (e_source_group_peek_base_uri (group), "exchange://"))
+ return;
+
uri = e_source_get_uri (source);
path = g_strdup_printf (uri + strlen ("exchange://") + strlen (account->account_filename));
sub_folder = strchr (path, '@');
- if (!sub_folder)
+ if (!sub_folder) {
+ g_free (path);
return;
+ }
for (i = 0; i < sizeof (popup_ab_items) / sizeof (popup_ab_items[0]); i++)
menus = g_slist_prepend (menus, &popup_ab_items[i]);
@@ -156,6 +163,7 @@ org_gnome_exchange_check_subscribed (EPlugin *ep, ECalPopupTargetSource *target)
gchar *path = NULL;
char *sub_folder = NULL;
ExchangeAccount *account = NULL;
+ ESourceGroup *group;
account = exchange_operations_get_exchange_account ();
@@ -163,12 +171,18 @@ org_gnome_exchange_check_subscribed (EPlugin *ep, ECalPopupTargetSource *target)
return;
source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector));
+ group = e_source_peek_group (source);
+ if (!group || strcmp (e_source_group_peek_base_uri (group), "exchange://"))
+ return;
+
ruri = (gchar *) e_source_peek_relative_uri (source);
path = g_strdup_printf (ruri + strlen (account->account_filename));
sub_folder = strchr (path, '@');
- if (!sub_folder)
+ if (!sub_folder) {
+ g_free (path);
return;
+ }
for (i = 0; i < sizeof (popup_items) / sizeof (popup_items[0]); i++)
menus = g_slist_prepend (menus, &popup_items[i]);