aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-02-17 13:06:10 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-02-17 13:06:10 +0800
commit2edcc77ca4cab6e255a7c1830ca56302e3c5e2e0 (patch)
treee194d5ce77207a656bf17bcfec4d3c7ff21f2c73 /mail
parent0c5435836a8cc45ec3d35edd57bf9ed9b05e6248 (diff)
downloadgsoc2013-evolution-2edcc77ca4cab6e255a7c1830ca56302e3c5e2e0.tar.gz
gsoc2013-evolution-2edcc77ca4cab6e255a7c1830ca56302e3c5e2e0.tar.zst
gsoc2013-evolution-2edcc77ca4cab6e255a7c1830ca56302e3c5e2e0.zip
** See bug #54200.
2004-02-17 Not Zed <NotZed@Ximian.com> ** See bug #54200. * em-popup.c (em_popup_target_new_select): add EM_POPUP_SELECT_FOLDER - to find out if we have a folder at all. Handle getting a NULL folder passed in. * em-folder-view.c (em_folder_view_get_popup_target): Added EM_FOLDER_VIEW_SELECT_FOLDER - to detect when we dont have a folder set on the emfolderview. * em-folder-browser.c (emfb_mark_all_read): if we don't have a folder, dont try and run. (emfb_enable_map[]): Disable a bunch of stuff we have no folder set. svn path=/trunk/; revision=24755
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog15
-rw-r--r--mail/em-folder-browser.c9
-rw-r--r--mail/em-folder-view.c2
-rw-r--r--mail/em-popup.c13
-rw-r--r--mail/em-popup.h1
5 files changed, 36 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 6f3ec334ab..d568017fb6 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,20 @@
2004-02-17 Not Zed <NotZed@Ximian.com>
+ ** See bug #54200.
+
+ * em-popup.c (em_popup_target_new_select): add
+ EM_POPUP_SELECT_FOLDER - to find out if we have a folder at
+ all. Handle getting a NULL folder passed in.
+
+ * em-folder-view.c (em_folder_view_get_popup_target): Added
+ EM_FOLDER_VIEW_SELECT_FOLDER - to detect when we dont have a
+ folder set on the emfolderview.
+
+ * em-folder-browser.c (emfb_mark_all_read): if we don't have a
+ folder, dont try and run.
+ (emfb_enable_map[]): Disable a bunch of stuff we have no
+ folder set.
+
* importers/pine-importer.c (import_contact): fix for the
weird-arsed e-contact list api. and fix a small memleak.
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index 745c44fa17..09d2a9b45e 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -562,7 +562,10 @@ emfb_mark_all_read(BonoboUIComponent *uid, void *data, const char *path)
EMFolderView *emfv = data;
GPtrArray *uids;
int i;
-
+
+ if (emfv->folder == NULL)
+ return;
+
uids = camel_folder_get_uids(emfv->folder);
camel_folder_freeze(emfv->folder);
for (i=0;i<uids->len;i++)
@@ -709,7 +712,11 @@ static EPixmap emfb_pixmaps[] = {
};
static const EMFolderViewEnable emfb_enable_map[] = {
+ { "EditInvertSelection", EM_POPUP_SELECT_FOLDER },
+ { "EditSelectAll", EM_POPUP_SELECT_FOLDER },
{ "EditSelectThread", EM_FOLDER_VIEW_SELECT_THREADED },
+ { "MailPost", EM_POPUP_SELECT_FOLDER },
+ { "MessageMarkAllAsRead", EM_POPUP_SELECT_FOLDER },
{ "ViewHideSelected", EM_POPUP_SELECT_MANY },
{ "ViewShowAll", EM_FOLDER_VIEW_SELECT_HIDDEN },
{ NULL },
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index 8c8deec7f1..0bad8e0221 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -1413,7 +1413,7 @@ static EPixmap emfv_message_pixmaps[] = {
static const EMFolderViewEnable emfv_enable_map[] = {
{ "EditCut", EM_POPUP_SELECT_MANY },
{ "EditCopy", EM_POPUP_SELECT_MANY },
- { "EditPaste", 0 },
+ { "EditPaste", EM_POPUP_SELECT_FOLDER },
/* FIXME: should these be single-selection? */
{ "MailNext", EM_POPUP_SELECT_MANY },
diff --git a/mail/em-popup.c b/mail/em-popup.c
index 58fbd9d2d8..4a8d86aeec 100644
--- a/mail/em-popup.c
+++ b/mail/em-popup.c
@@ -461,9 +461,17 @@ em_popup_target_new_select(struct _CamelFolder *folder, const char *folder_uri,
t->type = EM_POPUP_TARGET_SELECT;
t->data.select.uids = uids;
t->data.select.folder = folder;
- camel_object_ref(folder);
t->data.select.folder_uri = g_strdup(folder_uri);
+ if (folder == NULL) {
+ t->mask = mask;
+
+ return t;
+ }
+
+ camel_object_ref(folder);
+ mask &= ~EM_POPUP_SELECT_FOLDER;
+
if (em_utils_folder_is_sent(folder, folder_uri))
mask &= ~EM_POPUP_SELECT_RESEND;
@@ -635,7 +643,8 @@ em_popup_target_free(EMPopupTarget *t)
{
switch (t->type) {
case EM_POPUP_TARGET_SELECT:
- camel_object_unref(t->data.select.folder);
+ if (t->data.select.folder)
+ camel_object_unref(t->data.select.folder);
g_free(t->data.select.folder_uri);
if (t->data.select.uids)
em_utils_uids_free(t->data.select.uids);
diff --git a/mail/em-popup.h b/mail/em-popup.h
index f71d312b90..88a4ff83ab 100644
--- a/mail/em-popup.h
+++ b/mail/em-popup.h
@@ -90,6 +90,7 @@ enum {
EM_POPUP_SELECT_ADD_SENDER = 1<<14,
EM_POPUP_SELECT_MARK_JUNK = 1<<15,
EM_POPUP_SELECT_MARK_NOJUNK = 1<<16,
+ EM_POPUP_SELECT_FOLDER = 1<<17, /* do we have any folder at all? */
EM_POPUP_SELECT_LAST = 1<<18 /* reserve 2 slots */
};