From 8ca39c14e9a5dad782a3a26662775a914ba287df Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 12 Oct 2000 05:18:48 +0000 Subject: special case for folders with NULL urls (which aren't 2000-10-11 Chris Toshok * subscribe-dialog.c (folder_etree_value_at): special case for folders with NULL urls (which aren't selected/subscribeable). (unsubscribe_folder_info): can't (un)subscribe from folders with non-NULL urls. (subscribe_folder_info): same. svn path=/trunk/; revision=5879 --- mail/ChangeLog | 8 ++++++++ mail/subscribe-dialog.c | 28 +++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 0c2b5591d1..4803929966 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2000-10-11 Chris Toshok + + * subscribe-dialog.c (folder_etree_value_at): special case for + folders with NULL urls (which aren't selected/subscribeable). + (unsubscribe_folder_info): can't (un)subscribe from folders with + non-NULL urls. + (subscribe_folder_info): same. + 2000-10-12 Christopher James Lahey * message-list.c: Replace To with From except in Drafts, Outbox, diff --git a/mail/subscribe-dialog.c b/mail/subscribe-dialog.c index fc8b6b7282..d486df97df 100644 --- a/mail/subscribe-dialog.c +++ b/mail/subscribe-dialog.c @@ -144,8 +144,13 @@ static void subscribe_folder_info (SubscribeDialog *sc, CamelFolderInfo *info) { char *path; - CamelException *ex = camel_exception_new (); + CamelException *ex; + /* folders without urls cannot be subscribed to */ + if (info->url == NULL) + return; + + ex = camel_exception_new (); path = g_strdup_printf ("/%s", info->full_name); camel_store_subscribe_folder (sc->store, path, ex); @@ -166,8 +171,13 @@ static void unsubscribe_folder_info (SubscribeDialog *sc, CamelFolderInfo *info) { char *path; - CamelException *ex = camel_exception_new (); + CamelException *ex; + + /* folders without urls cannot be subscribed to */ + if (info->url == NULL) + return; + ex = camel_exception_new (); path = g_strdup_printf ("/%s", info->full_name); camel_store_unsubscribe_folder (sc->store, path, ex); @@ -381,10 +391,18 @@ folder_etree_value_at (ETreeModel *etree, ETreePath *path, int col, void *model_ SubscribeDialog *dialog = SUBSCRIBE_DIALOG (model_data); CamelFolderInfo *info = e_tree_model_node_get_data (etree, path); - if (col == FOLDER_COL_NAME) + if (col == FOLDER_COL_NAME) { return info->name; - else /* FOLDER_COL_SUBSCRIBED */ - return GINT_TO_POINTER(folder_info_subscribed(dialog, info)); + } + else /* FOLDER_COL_SUBSCRIBED */ { + /* folders without urls cannot be subscribed to */ + if (info->url == NULL) + return 0; /* empty */ + else if (!folder_info_subscribed(dialog, info)) + return 0; /* XXX unchecked */ + else + return 1; /* checked */ + } } static void -- cgit v1.2.3