aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2005-01-18 14:09:31 +0800
committerMichael Zucci <zucchi@src.gnome.org>2005-01-18 14:09:31 +0800
commitce004bd794e3cea909fada955e8f483b86a579f7 (patch)
treead29998a8245b35fd7557cca7b6630fdbf1b109b
parentc075b7d96c7c9e4bbfc32f1541c96c6a3ef538e3 (diff)
downloadgsoc2013-evolution-ce004bd794e3cea909fada955e8f483b86a579f7.tar.gz
gsoc2013-evolution-ce004bd794e3cea909fada955e8f483b86a579f7.tar.zst
gsoc2013-evolution-ce004bd794e3cea909fada955e8f483b86a579f7.zip
** See bug #70768.
2005-01-18 Not Zed <NotZed@Ximian.com> ** See bug #70768. * em-folder-browser.c (emfb_mark_all_read): get the uid list from the message-list (view) rather than folder (model). * message-list.c (message_list_foreach): removed, no longer used. (message_list_get_uids): new function replacing ml_foreach, get visible uids's of messages. svn path=/trunk/; revision=28425
-rw-r--r--mail/ChangeLog16
-rw-r--r--mail/em-folder-browser.c4
-rw-r--r--mail/em-folder-tree.c6
-rw-r--r--mail/message-list.c54
-rw-r--r--mail/message-list.h9
5 files changed, 37 insertions, 52 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index b2541d926f..880010df28 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,21 @@
2005-01-18 Not Zed <NotZed@Ximian.com>
+ ** See bug #70768.
+
+ * em-folder-browser.c (emfb_mark_all_read): get the uid list from
+ the message-list (view) rather than folder (model).
+
+ * message-list.c (message_list_foreach): removed, no longer used.
+ (message_list_get_uids): new function replacing ml_foreach, get
+ visible uids's of messages.
+
+2005-01-18 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #71105.
+
+ * em-folder-tree.c (emft_popup_rename_folder): dont let a user
+ rename a folder to one including '/'.
+
* em-format-html.c (emfh_gethttp): kill old 'load http 0 now=0' debug.
** See bug #70563.
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index 84362dc26c..fa2bd6aa85 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -588,12 +588,12 @@ emfb_mark_all_read(BonoboUIComponent *uid, void *data, const char *path)
if (emfv->folder == NULL)
return;
- uids = camel_folder_get_uids(emfv->folder);
+ uids = message_list_get_uids(emfv->list);
camel_folder_freeze(emfv->folder);
for (i=0;i<uids->len;i++)
camel_folder_set_message_flags(emfv->folder, uids->pdata[i], CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
camel_folder_thaw(emfv->folder);
- camel_folder_free_uids(emfv->folder, uids);
+ message_list_free_uids(emfv->list, uids);
}
static void
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index 9ba773e30f..ccf4d9c001 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -2664,7 +2664,11 @@ emft_popup_rename_folder (EPopup *ep, EPopupItem *pitem, void *data)
prompt = g_strdup_printf (_("Rename the \"%s\" folder to:"), name);
while (!done) {
new_name = e_request_string (NULL, _("Rename Folder"), prompt, name);
- if (new_name == NULL || !strcmp (name, new_name)) {
+ if (strchr(new_name, '/') != NULL) {
+ e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
+ "mail:no-rename-folder", name, new_name, _("Folder names cannot contain '/'"), NULL);
+ done = TRUE;
+ } else if (new_name == NULL || !strcmp (name, new_name)) {
/* old name == new name */
done = TRUE;
} else {
diff --git a/mail/message-list.c b/mail/message-list.c
index bbbd192cdb..688c45e437 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -2987,47 +2987,6 @@ on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, Mess
return TRUE;
}
-struct message_list_foreach_data {
- MessageList *message_list;
- MessageListForeachFunc callback;
- gpointer user_data;
-};
-
-static void
-mlfe_callback (ETreePath path, gpointer user_data)
-{
- struct message_list_foreach_data *mlfe_data = user_data;
- const char *uid;
-
- if (e_tree_model_node_is_root (mlfe_data->message_list->model, path))
- return;
-
- uid = get_message_uid (mlfe_data->message_list,
- path);
- if (uid) {
- mlfe_data->callback (mlfe_data->message_list, uid,
- mlfe_data->user_data);
- } else {
- /* FIXME: could this the cause of bug #6637 and friends? */
- g_warning ("I wonder if this could be the cause of bug #6637 and friends?");
- g_assert_not_reached ();
- }
-}
-
-void
-message_list_foreach (MessageList *message_list,
- MessageListForeachFunc callback,
- gpointer user_data)
-{
- struct message_list_foreach_data mlfe_data;
-
- mlfe_data.message_list = message_list;
- mlfe_data.callback = callback;
- mlfe_data.user_data = user_data;
- e_tree_selected_path_foreach (message_list->tree,
- mlfe_callback, &mlfe_data);
-}
-
struct _ml_selected_data {
MessageList *ml;
GPtrArray *uids;
@@ -3048,6 +3007,19 @@ ml_getselected_cb(ETreePath path, void *user_data)
}
GPtrArray *
+message_list_get_uids(MessageList *ml)
+{
+ struct _ml_selected_data data = {
+ ml,
+ g_ptr_array_new()
+ };
+
+ e_tree_path_foreach(ml->tree, ml_getselected_cb, &data);
+
+ return data.uids;
+}
+
+GPtrArray *
message_list_get_selected(MessageList *ml)
{
struct _ml_selected_data data = {
diff --git a/mail/message-list.h b/mail/message-list.h
index 1c09c2ce9f..b1e8b026f4 100644
--- a/mail/message-list.h
+++ b/mail/message-list.h
@@ -160,10 +160,6 @@ typedef struct {
void (*message_list_scrolled) (MessageList *ml);
} MessageListClass;
-typedef void (*MessageListForeachFunc) (MessageList *message_list,
- const char *uid,
- gpointer user_data);
-
typedef enum {
MESSAGE_LIST_SELECT_NEXT = 0,
MESSAGE_LIST_SELECT_PREVIOUS = 1,
@@ -175,13 +171,10 @@ GtkType message_list_get_type (void);
GtkWidget *message_list_new (void);
void message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder, const char *uri, gboolean outgoing);
-void message_list_foreach (MessageList *message_list,
- MessageListForeachFunc callback,
- gpointer user_data);
-
void message_list_freeze(MessageList *ml);
void message_list_thaw(MessageList *ml);
+GPtrArray *message_list_get_uids(MessageList *message_list);
GPtrArray *message_list_get_selected(MessageList *ml);
void message_list_set_selected(MessageList *ml, GPtrArray *uids);
void message_list_free_uids(MessageList *ml, GPtrArray *uids);