aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorChris Toshok <toshok@helixcode.com>2000-10-12 13:18:48 +0800
committerChris Toshok <toshok@src.gnome.org>2000-10-12 13:18:48 +0800
commit8ca39c14e9a5dad782a3a26662775a914ba287df (patch)
treed67eb4393546a32639bc73ad7571ebdcd483eb48 /mail
parent4f67f61e80997e10e1b66bff12f0b9ac6a2bfa5a (diff)
downloadgsoc2013-evolution-8ca39c14e9a5dad782a3a26662775a914ba287df.tar.gz
gsoc2013-evolution-8ca39c14e9a5dad782a3a26662775a914ba287df.tar.zst
gsoc2013-evolution-8ca39c14e9a5dad782a3a26662775a914ba287df.zip
special case for folders with NULL urls (which aren't
2000-10-11 Chris Toshok <toshok@helixcode.com> * 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
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/subscribe-dialog.c28
2 files changed, 31 insertions, 5 deletions
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 <toshok@helixcode.com>
+
+ * 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 <clahey@helixcode.com>
* 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