aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog20
-rw-r--r--mail/em-folder-tree.c4
-rw-r--r--mail/em-popup.c18
-rw-r--r--mail/em-popup.h2
-rw-r--r--mail/mail-folder-cache.c19
5 files changed, 47 insertions, 16 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 24e9f9a199..a0a2d6f903 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,23 @@
+2004-02-12 Jeffrey Stedfast <fejj@ximian.com>
+
+ * em-folder-tree.c (emft_tree_button_press): Updated for em-popup
+ API change (altho currently passes a dummy value).
+
+ * em-popup.c (em_popup_target_new_folder): Check for vTrash/vJunk
+ by checking the CAMEL_FOLDER_VIRTUAL info flags bit. (perhaps this
+ flag should be renamed to SPECIAL? VIRTUAL might not have been a
+ good name). Also changed to check flags & CAMEL_FOLDER_NOSELECT
+ rather than checking the uri string for a noselect param.
+
+ * mail-folder-cache.c (unset_folder_info): Instead of checking for
+ ";noselect" in the uri, check for a CAMEL_FOLDER_NOSELECT flag on
+ mfi->flags.
+ (setup_folder): Copy the fi->flags to mfi->flags here.
+ (rename_folders): Same.
+ (setup_folder): Check fi->flags for CAMEL_FOLDER_NOSELECT here
+ instead.
+ (rename_folders): Same. Also gets rid of a FIXME.
+
2004-02-18 Jeffrey Stedfast <fejj@ximian.com>
* em-format-html-display.c (efhd_xpkcs7mime_validity_clicked):
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index d6cfb977be..0e1c6c4357 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -2224,7 +2224,9 @@ emft_tree_button_press (GtkWidget *treeview, GdkEventButton *event, EMFolderTree
selection = gtk_tree_view_get_selection (priv->treeview);
emft_selection_get_selected (selection, &model, &iter);
gtk_tree_model_get (model, &iter, COL_STRING_URI, &uri, COL_BOOL_IS_STORE, &isstore, -1);
- target = em_popup_target_new_folder(uri, isstore);
+
+ /* FIXME: pass valid fi->flags here */
+ target = em_popup_target_new_folder(uri, 0, isstore);
for (i = 0; i < sizeof (emft_popup_menu) / sizeof (emft_popup_menu[0]); i++) {
EMPopupItem *item = &emft_popup_menu[i];
diff --git a/mail/em-popup.c b/mail/em-popup.c
index 4a8d86aeec..8f154ade93 100644
--- a/mail/em-popup.c
+++ b/mail/em-popup.c
@@ -46,6 +46,7 @@
#include "e-util/e-msgport.h"
#include "em-utils.h"
+#include <camel/camel-store.h>
#include <camel/camel-folder.h>
#include <camel/camel-mime-message.h>
#include <camel/camel-string-utils.h>
@@ -584,7 +585,7 @@ em_popup_target_new_part(struct _CamelMimePart *part, const char *mime_type)
/* TODO: This should be based on the CamelFolderInfo, but ... em-folder-tree doesn't keep it? */
EMPopupTarget *
-em_popup_target_new_folder(const char *uri, int isstore)
+em_popup_target_new_folder(const char *uri, guint32 info_flags, int isstore)
{
EMPopupTarget *t = g_malloc0(sizeof(*t));
guint32 mask = ~0;
@@ -619,15 +620,14 @@ em_popup_target_new_folder(const char *uri, int isstore)
/* more hack, for maildir root */
|| strcmp(path, ".") == 0))
mask |= EM_POPUP_FOLDER_DELETE|EM_POPUP_FOLDER_INFERIORS;
-
- /* since vtrash/vjunk currently make scarily bogus
- * url's, we have to check this too */
- if (strcmp(url->protocol, "vtrash") == 0
- || strcmp(url->protocol, "vjunk") == 0)
- mask |= EM_POPUP_FOLDER_DELETE|EM_POPUP_FOLDER_INFERIORS;
+
/* end hack bit */
-
- if (camel_url_get_param(url, "noselect") == NULL)
+
+ /* check for vTrash/vJunk */
+ if (info_flags & CAMEL_FOLDER_VIRTUAL)
+ mask |= EM_POPUP_FOLDER_DELETE|EM_POPUP_FOLDER_INFERIORS;
+
+ if (info_flags & CAMEL_FOLDER_NOSELECT)
mask &= ~EM_POPUP_FOLDER_SELECT;
}
diff --git a/mail/em-popup.h b/mail/em-popup.h
index 88a4ff83ab..3cc82840f4 100644
--- a/mail/em-popup.h
+++ b/mail/em-popup.h
@@ -165,7 +165,7 @@ struct _GtkMenu *em_popup_create_menu_once(EMPopup *emp, EMPopupTarget *, guint3
EMPopupTarget *em_popup_target_new_uri(const char *uri);
EMPopupTarget *em_popup_target_new_select(struct _CamelFolder *folder, const char *folder_uri, GPtrArray *uids);
EMPopupTarget *em_popup_target_new_part(struct _CamelMimePart *part, const char *mime_type);
-EMPopupTarget *em_popup_target_new_folder(const char *uri, int isstore);
+EMPopupTarget *em_popup_target_new_folder(const char *uri, guint32 info_flags, int isstore);
void em_popup_target_free(EMPopupTarget *target);
#ifdef __cplusplus
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 0887f55bca..ecadeb50b5 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -69,7 +69,9 @@ struct _folder_info {
char *path; /* shell path */
char *full_name; /* full name of folder/folderinfo */
char *uri; /* uri of folder */
-
+
+ guint32 flags;
+
CamelFolder *folder; /* if known */
};
@@ -272,7 +274,7 @@ unset_folder_info(struct _folder_info *mfi, int delete, int unsub)
camel_object_unhook_event(folder, "finalize", folder_finalised, mfi);
}
- if (strstr(mfi->uri, ";noselect") == NULL) {
+ if (mfi->flags & CAMEL_FOLDER_NOSELECT) {
up = g_malloc0(sizeof(*up));
up->remove = TRUE;
@@ -377,6 +379,8 @@ setup_folder(CamelFolderInfo *fi, struct _store_info *si)
mfi->full_name = g_strdup(fi->full_name);
mfi->uri = g_strdup(fi->url);
mfi->store_info = si;
+ mfi->flags = fi->flags;
+
g_hash_table_insert(si->folders, mfi->full_name, mfi);
g_hash_table_insert(si->folders_uri, mfi->uri, mfi);
@@ -387,7 +391,8 @@ setup_folder(CamelFolderInfo *fi, struct _store_info *si)
up->unread = (fi->unread_message_count==-1)?0:fi->unread_message_count;
up->store = si->store;
camel_object_ref(up->store);
- if (strstr(fi->url, ";noselect") == NULL)
+
+ if (fi->flags & CAMEL_FOLDER_NOSELECT)
up->add = TRUE;
e_dlist_addtail(&updates, (EDListNode *)up);
@@ -595,6 +600,8 @@ rename_folders(struct _store_info *si, const char *oldbase, const char *newbase,
mfi->path = g_strdup(fi->path);
mfi->full_name = g_strdup(fi->full_name);
mfi->uri = g_strdup(fi->url);
+ mfi->flags = fi->flags;
+
g_hash_table_insert(si->folders, mfi->full_name, mfi);
g_hash_table_insert(si->folders_uri, mfi->uri, mfi);
} else {
@@ -605,6 +612,8 @@ rename_folders(struct _store_info *si, const char *oldbase, const char *newbase,
mfi->full_name = g_strdup(fi->full_name);
mfi->uri = g_strdup(fi->url);
mfi->store_info = si;
+ mfi->flags = fi->flags;
+
g_hash_table_insert(si->folders, mfi->full_name, mfi);
g_hash_table_insert(si->folders_uri, mfi->uri, mfi);
}
@@ -617,8 +626,8 @@ rename_folders(struct _store_info *si, const char *oldbase, const char *newbase,
up->unread = fi->unread_message_count==-1?0:fi->unread_message_count;
up->store = si->store;
camel_object_ref(up->store);
- /* FIXME: use fi->flags */
- if (strstr(fi->url, ";noselect") == NULL)
+
+ if (fi->flags & CAMEL_FOLDER_NOSELECT)
up->add = TRUE;
e_dlist_addtail(&updates, (EDListNode *)up);