aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-12-01 03:46:26 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-12-01 07:34:38 +0800
commitd94534c3673956164f9fb2c7f6b12188994503ae (patch)
treec26a8a2edb293478b2ad43e36de5feebaf84ce1d
parent420a4ccb20825d618b06c6be742c2c47cc15ca71 (diff)
downloadgsoc2013-evolution-d94534c3673956164f9fb2c7f6b12188994503ae.tar.gz
gsoc2013-evolution-d94534c3673956164f9fb2c7f6b12188994503ae.tar.zst
gsoc2013-evolution-d94534c3673956164f9fb2c7f6b12188994503ae.zip
Merge bits and pieces of the anjal-evo-2-30 branch.
-rw-r--r--composer/e-composer-header-table.c22
-rw-r--r--composer/e-composer-header-table.h4
-rw-r--r--e-util/e-marshal.list1
-rw-r--r--mail/e-mail-browser.c17
-rw-r--r--mail/e-mail-reader-utils.c67
-rw-r--r--mail/e-mail-reader.c272
-rw-r--r--mail/e-mail-reader.h12
-rw-r--r--mail/e-mail-store.c6
-rw-r--r--mail/em-utils.c16
-rw-r--r--mail/mail-mt.c10
-rw-r--r--mail/mail-send-recv.c2
-rw-r--r--modules/mail/e-mail-shell-content.c1
-rw-r--r--modules/mail/e-mail-shell-sidebar.c25
-rw-r--r--modules/mail/e-mail-shell-view-actions.c139
-rw-r--r--modules/mail/e-mail-shell-view-private.h1
-rw-r--r--modules/mail/e-mail-shell-view.c17
-rw-r--r--plugins/groupwise-features/gw-ui.c7
-rw-r--r--plugins/groupwise-features/junk-mail-settings.c7
-rw-r--r--plugins/groupwise-features/mail-retract.c9
-rw-r--r--plugins/groupwise-features/status-track.c9
-rw-r--r--plugins/mail-to-task/mail-to-task.c7
-rw-r--r--plugins/mailing-list-actions/mailing-list-actions.c9
-rw-r--r--plugins/templates/templates.c9
23 files changed, 376 insertions, 293 deletions
diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c
index e7972e2ef9..b23d386195 100644
--- a/composer/e-composer-header-table.c
+++ b/composer/e-composer-header-table.c
@@ -1516,3 +1516,25 @@ e_composer_header_table_set_subject (EComposerHeaderTable *table,
e_composer_text_header_set_text (text_header, subject);
}
+
+void
+e_composer_header_table_set_header_visible (EComposerHeaderTable *table,
+ EComposerHeaderType type,
+ gboolean visible)
+{
+ EComposerHeader *header;
+
+ header = e_composer_header_table_get_header (table, type);
+ e_composer_header_set_visible (header, visible);
+
+ /* Signature widgets track the "From" header. */
+ if (type == E_COMPOSER_HEADER_FROM) {
+ if (visible) {
+ gtk_widget_show (table->priv->signature_label);
+ gtk_widget_show (table->priv->signature_combo_box);
+ } else {
+ gtk_widget_hide (table->priv->signature_label);
+ gtk_widget_hide (table->priv->signature_combo_box);
+ }
+ }
+}
diff --git a/composer/e-composer-header-table.h b/composer/e-composer-header-table.h
index 91ad56da46..9fe9f5bd23 100644
--- a/composer/e-composer-header-table.h
+++ b/composer/e-composer-header-table.h
@@ -149,6 +149,10 @@ const gchar * e_composer_header_table_get_subject
void e_composer_header_table_set_subject
(EComposerHeaderTable *table,
const gchar *subject);
+void e_composer_header_table_set_header_visible
+ (EComposerHeaderTable *table,
+ EComposerHeaderType type,
+ gboolean visible);
G_END_DECLS
diff --git a/e-util/e-marshal.list b/e-util/e-marshal.list
index 9e19bae64d..813234b4d6 100644
--- a/e-util/e-marshal.list
+++ b/e-util/e-marshal.list
@@ -1,4 +1,5 @@
BOOLEAN:BOXED,STRING
+BOOLEAN:BOXED,POINTER,POINTER
BOOLEAN:INT,INT,OBJECT,INT,INT,UINT
BOOLEAN:INT,POINTER,INT,OBJECT,INT,INT,UINT
BOOLEAN:NONE
diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c
index e605e27267..e0d6aa9e16 100644
--- a/mail/e-mail-browser.c
+++ b/mail/e-mail-browser.c
@@ -193,8 +193,9 @@ mail_browser_message_selected_cb (EMailBrowser *browser,
const gchar *uid)
{
EMFormatHTMLDisplay *html_display;
- MessageList *message_list;
+ GtkWidget *message_list;
CamelMessageInfo *info;
+ CamelFolder *folder;
EMailReader *reader;
if (uid == NULL)
@@ -203,7 +204,9 @@ mail_browser_message_selected_cb (EMailBrowser *browser,
reader = E_MAIL_READER (browser);
html_display = e_mail_reader_get_html_display (reader);
message_list = e_mail_reader_get_message_list (reader);
- info = camel_folder_get_message_info (message_list->folder, uid);
+
+ folder = MESSAGE_LIST (message_list)->folder;
+ info = camel_folder_get_message_info (folder, uid);
if (info == NULL)
return;
@@ -214,7 +217,7 @@ mail_browser_message_selected_cb (EMailBrowser *browser,
gtk_widget_grab_focus (
GTK_WIDGET (((EMFormatHTML *) html_display)->html));
- camel_folder_free_message_info (message_list->folder, info);
+ camel_folder_free_message_info (folder, info);
}
static gboolean
@@ -558,14 +561,14 @@ mail_browser_get_html_display (EMailReader *reader)
return priv->html_display;
}
-static MessageList *
+static GtkWidget *
mail_browser_get_message_list (EMailReader *reader)
{
EMailBrowserPrivate *priv;
priv = E_MAIL_BROWSER_GET_PRIVATE (reader);
- return MESSAGE_LIST (priv->message_list);
+ return priv->message_list;
}
static GtkMenu *
@@ -603,7 +606,7 @@ mail_browser_set_message (EMailReader *reader,
const gchar *uid)
{
EMailReaderIface *iface;
- MessageList *message_list;
+ GtkWidget *message_list;
CamelMessageInfo *info;
CamelFolder *folder;
@@ -618,7 +621,7 @@ mail_browser_set_message (EMailReader *reader,
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
+ folder = MESSAGE_LIST (message_list)->folder;
info = camel_folder_get_message_info (folder, uid);
if (info != NULL) {
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c
index e7a294f349..f1ef1034b1 100644
--- a/mail/e-mail-reader-utils.c
+++ b/mail/e-mail-reader-utils.c
@@ -40,6 +40,7 @@
#include "mail/mail-ops.h"
#include "mail/mail-tools.h"
#include "mail/mail-vfolder.h"
+#include "mail/message-list.h"
void
e_mail_reader_activate (EMailReader *reader,
@@ -64,10 +65,10 @@ e_mail_reader_confirm_delete (EMailReader *reader)
EShell *shell;
EShellBackend *shell_backend;
EShellSettings *shell_settings;
- MessageList *message_list;
CamelFolder *folder;
GtkWidget *check_button;
GtkWidget *content_area;
+ GtkWidget *message_list;
GtkWidget *dialog;
GtkWindow *window;
const gchar *label;
@@ -85,7 +86,7 @@ e_mail_reader_confirm_delete (EMailReader *reader)
shell = e_shell_backend_get_shell (shell_backend);
shell_settings = e_shell_get_shell_settings (shell);
- folder = message_list->folder;
+ folder = MESSAGE_LIST (message_list)->folder;
prompt_delete_in_vfolder = e_shell_settings_get_boolean (
shell_settings, "mail-prompt-delete-in-vfolder");
@@ -130,7 +131,7 @@ e_mail_reader_mark_as_read (EMailReader *reader,
const gchar *uid)
{
EMFormatHTMLDisplay *html_display;
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
guint32 mask, set;
guint32 flags;
@@ -141,7 +142,7 @@ e_mail_reader_mark_as_read (EMailReader *reader,
html_display = e_mail_reader_get_html_display (reader);
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
+ folder = MESSAGE_LIST (message_list)->folder;
flags = camel_folder_get_message_flags (folder, uid);
if (!(flags & CAMEL_MESSAGE_SEEN)) {
@@ -161,7 +162,7 @@ e_mail_reader_mark_selected (EMailReader *reader,
guint32 mask,
guint32 set)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GPtrArray *uids;
guint ii;
@@ -170,18 +171,18 @@ e_mail_reader_mark_selected (EMailReader *reader,
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
+ folder = MESSAGE_LIST (message_list)->folder;
if (folder == NULL)
return 0;
camel_folder_freeze (folder);
- uids = message_list_get_selected (message_list);
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
for (ii = 0; ii < uids->len; ii++)
camel_folder_set_message_flags (
folder, uids->pdata[ii], mask, set);
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
camel_folder_thaw (folder);
return ii;
@@ -191,7 +192,7 @@ guint
e_mail_reader_open_selected (EMailReader *reader)
{
EShellBackend *shell_backend;
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkWindow *window;
GPtrArray *views;
@@ -205,12 +206,12 @@ e_mail_reader_open_selected (EMailReader *reader)
shell_backend = e_mail_reader_get_shell_backend (reader);
window = e_mail_reader_get_window (reader);
- folder = message_list->folder;
- folder_uri = message_list->folder_uri;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
if (!em_utils_ask_open_many (window, uids->len)) {
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
return 0;
}
@@ -273,7 +274,7 @@ e_mail_reader_open_selected (EMailReader *reader)
g_ptr_array_free (views, TRUE);
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
return ii;
}
@@ -282,7 +283,7 @@ void
e_mail_reader_print (EMailReader *reader,
GtkPrintOperationAction action)
{
- MessageList *message_list;
+ GtkWidget *message_list;
EMFormatHTMLDisplay *html_display;
EMFormatHTMLPrint *html_print;
CamelFolder *folder;
@@ -293,11 +294,11 @@ e_mail_reader_print (EMailReader *reader,
html_display = e_mail_reader_get_html_display (reader);
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
+ folder = MESSAGE_LIST (message_list)->folder;
g_return_if_fail (folder != NULL);
/* XXX Learn to handle len > 1. */
- uids = message_list_get_selected (message_list);
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
if (uids->len != 1)
goto exit;
@@ -310,7 +311,7 @@ e_mail_reader_print (EMailReader *reader,
g_object_unref (html_print);
exit:
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
}
/* Helper for e_mail_reader_reply_to_message()
@@ -361,7 +362,7 @@ e_mail_reader_reply_to_message (EMailReader *reader,
gint reply_mode)
{
EMFormatHTMLDisplay *html_display;
- MessageList *message_list;
+ GtkWidget *message_list;
CamelMimeMessage *new_message;
CamelMimeMessage *src_message;
CamelFolder *folder;
@@ -384,8 +385,8 @@ e_mail_reader_reply_to_message (EMailReader *reader,
message_list = e_mail_reader_get_message_list (reader);
window = e_mail_reader_get_window (reader);
- folder = message_list->folder;
- uid = message_list->cursor_uid;
+ folder = MESSAGE_LIST (message_list)->folder;
+ uid = MESSAGE_LIST (message_list)->cursor_uid;
g_return_if_fail (uid != NULL);
if (!gtk_html_command (html, "is-selection-active"))
@@ -437,7 +438,7 @@ void
e_mail_reader_select_next_message (EMailReader *reader,
gboolean or_else_previous)
{
- MessageList *message_list;
+ GtkWidget *message_list;
gboolean hide_deleted;
gboolean success;
@@ -447,11 +448,13 @@ e_mail_reader_select_next_message (EMailReader *reader,
message_list = e_mail_reader_get_message_list (reader);
success = message_list_select (
- message_list, MESSAGE_LIST_SELECT_NEXT, 0, 0);
+ MESSAGE_LIST (message_list),
+ MESSAGE_LIST_SELECT_NEXT, 0, 0);
if (!success && (hide_deleted || or_else_previous))
message_list_select (
- message_list, MESSAGE_LIST_SELECT_PREVIOUS, 0, 0);
+ MESSAGE_LIST (message_list),
+ MESSAGE_LIST_SELECT_PREVIOUS, 0, 0);
}
/* Helper for e_mail_reader_create_filter_from_selected() */
@@ -477,7 +480,7 @@ void
e_mail_reader_create_filter_from_selected (EMailReader *reader,
gint filter_type)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
const gchar *filter_source;
const gchar *folder_uri;
@@ -492,8 +495,8 @@ e_mail_reader_create_filter_from_selected (EMailReader *reader,
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
- folder_uri = message_list->folder_uri;
+ folder = MESSAGE_LIST (message_list)->folder;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
if (em_utils_folder_is_sent (folder, folder_uri))
filter_source = E_FILTER_SOURCE_OUTGOING;
@@ -502,7 +505,7 @@ e_mail_reader_create_filter_from_selected (EMailReader *reader,
else
filter_source = E_FILTER_SOURCE_INCOMING;
- uids = message_list_get_selected (message_list);
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
if (uids->len == 1) {
filter_data = g_malloc (sizeof (*filter_data));
@@ -542,7 +545,7 @@ void
e_mail_reader_create_vfolder_from_selected (EMailReader *reader,
gint vfolder_type)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
const gchar *folder_uri;
GPtrArray *uids;
@@ -556,10 +559,10 @@ e_mail_reader_create_vfolder_from_selected (EMailReader *reader,
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
- folder_uri = message_list->folder_uri;
+ folder = MESSAGE_LIST (message_list)->folder;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
- uids = message_list_get_selected (message_list);
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
if (uids->len == 1) {
vfolder_data = g_malloc (sizeof (*vfolder_data));
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index f70b32af6a..346b03c056 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -48,6 +48,7 @@
#include "mail/mail-config.h"
#include "mail/mail-ops.h"
#include "mail/mail-vfolder.h"
+#include "mail/message-list.h"
enum {
CHANGED,
@@ -68,7 +69,7 @@ action_mail_add_sender_cb (GtkAction *action,
{
EShell *shell;
EShellBackend *shell_backend;
- MessageList *message_list;
+ GtkWidget *message_list;
CamelMessageInfo *info;
CamelFolder *folder;
GPtrArray *uids;
@@ -77,8 +78,8 @@ action_mail_add_sender_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
shell_backend = e_mail_reader_get_shell_backend (reader);
- folder = message_list->folder;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
if (uids->len != 1)
goto exit;
@@ -158,14 +159,14 @@ static void
action_mail_check_for_junk_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GPtrArray *uids;
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
mail_filter_junk (folder, uids);
}
@@ -187,7 +188,7 @@ static void
action_mail_copy_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkWidget *folder_tree;
GtkWidget *dialog;
@@ -199,9 +200,9 @@ action_mail_copy_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
folder_tree = em_folder_tree_new ();
- selected = message_list_get_selected (message_list);
+ selected = message_list_get_selected (MESSAGE_LIST (message_list));
- folder = message_list->folder;
+ folder = MESSAGE_LIST (message_list)->folder;
em_folder_tree_set_excluded (
EM_FOLDER_TREE (folder_tree),
@@ -289,14 +290,14 @@ static void
action_mail_filters_apply_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GPtrArray *uids;
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
mail_filter_on_demand (folder, uids);
}
@@ -313,7 +314,7 @@ action_mail_flag_clear_cb (GtkAction *action,
EMailReader *reader)
{
EMFormatHTMLDisplay *html_display;
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkWindow *window;
GPtrArray *uids;
@@ -322,8 +323,8 @@ action_mail_flag_clear_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
window = e_mail_reader_get_window (reader);
- folder = message_list->folder;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
em_utils_flag_for_followup_clear (window, folder, uids);
@@ -335,7 +336,7 @@ action_mail_flag_completed_cb (GtkAction *action,
EMailReader *reader)
{
EMFormatHTMLDisplay *html_display;
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkWindow *window;
GPtrArray *uids;
@@ -344,8 +345,8 @@ action_mail_flag_completed_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
window = e_mail_reader_get_window (reader);
- folder = message_list->folder;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
em_utils_flag_for_followup_completed (window, folder, uids);
@@ -356,7 +357,7 @@ static void
action_mail_flag_for_followup_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkWindow *window;
GPtrArray *uids;
@@ -364,8 +365,8 @@ action_mail_flag_for_followup_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
window = e_mail_reader_get_window (reader);
- folder = message_list->folder;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
em_utils_flag_for_followup (reader, folder, uids);
}
@@ -374,7 +375,7 @@ static void
action_mail_forward_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkWindow *window;
GPtrArray *uids;
@@ -383,22 +384,22 @@ action_mail_forward_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
window = e_mail_reader_get_window (reader);
- folder = message_list->folder;
- folder_uri = message_list->folder_uri;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
g_return_if_fail (uids != NULL);
if (em_utils_ask_open_many (window, uids->len))
em_utils_forward_messages (folder, uids, folder_uri);
else
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
}
static void
action_mail_forward_attached_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkWindow *window;
GPtrArray *uids;
@@ -407,22 +408,22 @@ action_mail_forward_attached_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
window = e_mail_reader_get_window (reader);
- folder = message_list->folder;
- folder_uri = message_list->folder_uri;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
g_return_if_fail (uids != NULL);
if (em_utils_ask_open_many (window, uids->len))
em_utils_forward_attached (folder, uids, folder_uri);
else
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
}
static void
action_mail_forward_inline_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkWindow *window;
GPtrArray *uids;
@@ -431,22 +432,22 @@ action_mail_forward_inline_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
window = e_mail_reader_get_window (reader);
- folder = message_list->folder;
- folder_uri = message_list->folder_uri;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
g_return_if_fail (uids != NULL);
if (em_utils_ask_open_many (window, uids->len))
em_utils_forward_inline (folder, uids, folder_uri);
else
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
}
static void
action_mail_forward_quoted_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkWindow *window;
GPtrArray *uids;
@@ -455,15 +456,15 @@ action_mail_forward_quoted_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
window = e_mail_reader_get_window (reader);
- folder = message_list->folder;
- folder_uri = message_list->folder_uri;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
g_return_if_fail (uids != NULL);
if (em_utils_ask_open_many (window, uids->len))
em_utils_forward_quoted (folder, uids, folder_uri);
else
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
}
static void
@@ -536,7 +537,7 @@ static void
action_mail_mark_unread_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
guint32 mask = CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_DELETED;
guint32 set = 0;
@@ -544,9 +545,9 @@ action_mail_mark_unread_cb (GtkAction *action,
e_mail_reader_mark_selected (reader, mask, set);
- if (message_list->seen_id != 0) {
- g_source_remove (message_list->seen_id);
- message_list->seen_id = 0;
+ if (MESSAGE_LIST (message_list)->seen_id != 0) {
+ g_source_remove (MESSAGE_LIST (message_list)->seen_id);
+ MESSAGE_LIST (message_list)->seen_id = 0;
}
}
@@ -554,7 +555,7 @@ static void
action_mail_message_edit_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkWindow *window;
GPtrArray *uids;
@@ -562,8 +563,8 @@ action_mail_message_edit_cb (GtkAction *action,
window = e_mail_reader_get_window (reader);
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
em_utils_edit_messages (folder, uids, FALSE);
}
@@ -572,13 +573,14 @@ static void
action_mail_message_new_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
- GtkWindow *window;
+ GtkWidget *message_list;
+ const gchar *folder_uri;
message_list = e_mail_reader_get_message_list (reader);
- window = e_mail_reader_get_window (reader);
- em_utils_compose_new_message (message_list->folder_uri);
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
+
+ em_utils_compose_new_message (folder_uri);
}
static void
@@ -592,7 +594,7 @@ static void
action_mail_move_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkWidget *folder_tree;
GtkWidget *dialog;
@@ -604,9 +606,9 @@ action_mail_move_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
folder_tree = em_folder_tree_new ();
- selected = message_list_get_selected (message_list);
+ selected = message_list_get_selected (MESSAGE_LIST (message_list));
- folder = message_list->folder;
+ folder = MESSAGE_LIST (message_list)->folder;
em_folder_tree_set_excluded (
EM_FOLDER_TREE (folder_tree),
@@ -649,7 +651,7 @@ static void
action_mail_next_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
MessageListSelectDirection direction;
guint32 flags, mask;
@@ -658,14 +660,16 @@ action_mail_next_cb (GtkAction *action,
mask = 0;
message_list = e_mail_reader_get_message_list (reader);
- message_list_select (message_list, direction, flags, mask);
+
+ message_list_select (
+ MESSAGE_LIST (message_list), direction, flags, mask);
}
static void
action_mail_next_important_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
MessageListSelectDirection direction;
guint32 flags, mask;
@@ -674,24 +678,27 @@ action_mail_next_important_cb (GtkAction *action,
mask = CAMEL_MESSAGE_FLAGGED;
message_list = e_mail_reader_get_message_list (reader);
- message_list_select (message_list, direction, flags, mask);
+
+ message_list_select (
+ MESSAGE_LIST (message_list), direction, flags, mask);
}
static void
action_mail_next_thread_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
message_list = e_mail_reader_get_message_list (reader);
- message_list_select_next_thread (message_list);
+
+ message_list_select_next_thread (MESSAGE_LIST (message_list));
}
static void
action_mail_next_unread_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
MessageListSelectDirection direction;
guint32 flags, mask;
@@ -700,14 +707,16 @@ action_mail_next_unread_cb (GtkAction *action,
mask = CAMEL_MESSAGE_SEEN;
message_list = e_mail_reader_get_message_list (reader);
- message_list_select (message_list, direction, flags, mask);
+
+ message_list_select (
+ MESSAGE_LIST (message_list), direction, flags, mask);
}
static void
action_mail_previous_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
MessageListSelectDirection direction;
guint32 flags, mask;
@@ -716,14 +725,16 @@ action_mail_previous_cb (GtkAction *action,
mask = 0;
message_list = e_mail_reader_get_message_list (reader);
- message_list_select (message_list, direction, flags, mask);
+
+ message_list_select (
+ MESSAGE_LIST (message_list), direction, flags, mask);
}
static void
action_mail_previous_important_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
MessageListSelectDirection direction;
guint32 flags, mask;
@@ -732,14 +743,16 @@ action_mail_previous_important_cb (GtkAction *action,
mask = CAMEL_MESSAGE_FLAGGED;
message_list = e_mail_reader_get_message_list (reader);
- message_list_select (message_list, direction, flags, mask);
+
+ message_list_select (
+ MESSAGE_LIST (message_list), direction, flags, mask);
}
static void
action_mail_previous_unread_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
MessageListSelectDirection direction;
guint32 flags, mask;
@@ -748,7 +761,9 @@ action_mail_previous_unread_cb (GtkAction *action,
mask = CAMEL_MESSAGE_SEEN;
message_list = e_mail_reader_get_message_list (reader);
- message_list_select (message_list, direction, flags, mask);
+
+ message_list_select (
+ MESSAGE_LIST (message_list), direction, flags, mask);
}
static void
@@ -775,7 +790,7 @@ static void
action_mail_redirect_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkWindow *window;
const gchar *uid;
@@ -783,8 +798,8 @@ action_mail_redirect_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
window = e_mail_reader_get_window (reader);
- folder = message_list->folder;
- uid = message_list->cursor_uid;
+ folder = MESSAGE_LIST (message_list)->folder;
+ uid = MESSAGE_LIST (message_list)->cursor_uid;
g_return_if_fail (uid != NULL);
em_utils_redirect_message_by_uid (folder, uid);
@@ -817,7 +832,7 @@ action_mail_save_as_cb (GtkAction *action,
{
EShell *shell;
EShellBackend *shell_backend;
- MessageList *message_list;
+ GtkWidget *message_list;
CamelMessageInfo *info;
CamelFolder *folder;
GPtrArray *uids;
@@ -830,8 +845,8 @@ action_mail_save_as_cb (GtkAction *action,
shell_backend = e_mail_reader_get_shell_backend (reader);
shell = e_shell_backend_get_shell (shell_backend);
- folder = message_list->folder;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
g_return_if_fail (uids->len > 0);
title = ngettext ("Save Message", "Save Messages", uids->len);
@@ -932,7 +947,7 @@ action_mail_show_source_cb (GtkAction *action,
{
EMFormatHTMLDisplay *html_display;
EShellBackend *shell_backend;
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkWidget *browser;
GPtrArray *uids;
@@ -941,9 +956,9 @@ action_mail_show_source_cb (GtkAction *action,
message_list = e_mail_reader_get_message_list (reader);
shell_backend = e_mail_reader_get_shell_backend (reader);
- folder = message_list->folder;
- folder_uri = message_list->folder_uri;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
g_return_if_fail (uids->len > 0);
browser = e_mail_browser_new (shell_backend);
@@ -954,22 +969,22 @@ action_mail_show_source_cb (GtkAction *action,
e_mail_reader_set_message (reader, uids->pdata[0]);
gtk_widget_show (browser);
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
}
static void
action_mail_toggle_important_cb (GtkAction *action,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GPtrArray *uids;
guint ii;
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
camel_folder_freeze (folder);
@@ -988,7 +1003,7 @@ action_mail_toggle_important_cb (GtkAction *action,
camel_folder_thaw (folder);
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
}
static void
@@ -1045,7 +1060,7 @@ action_search_folder_recipient_cb (GtkAction *action,
EMailReader *reader)
{
EMFormatHTMLDisplay *html_display;
- MessageList *message_list;
+ GtkWidget *message_list;
EWebView *web_view;
CamelURL *curl;
const gchar *uri;
@@ -1070,7 +1085,7 @@ action_search_folder_recipient_cb (GtkAction *action,
/* Ensure vfolder is running. */
vfolder_load_storage ();
- folder_uri = message_list->folder_uri;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
inet_addr = camel_internet_address_new ();
camel_address_decode (CAMEL_ADDRESS (inet_addr), curl->path);
@@ -1086,7 +1101,7 @@ action_search_folder_sender_cb (GtkAction *action,
EMailReader *reader)
{
EMFormatHTMLDisplay *html_display;
- MessageList *message_list;
+ GtkWidget *message_list;
EWebView *web_view;
CamelURL *curl;
const gchar *uri;
@@ -1111,7 +1126,7 @@ action_search_folder_sender_cb (GtkAction *action,
/* Ensure vfolder is running. */
vfolder_load_storage ();
- folder_uri = message_list->folder_uri;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
inet_addr = camel_internet_address_new ();
camel_address_decode (CAMEL_ADDRESS (inet_addr), curl->path);
@@ -1790,7 +1805,8 @@ mail_reader_key_press_cb (EMailReader *reader,
static gboolean
mail_reader_message_read_cb (EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
+ const gchar *cursor_uid;
const gchar *uid;
message_list = e_mail_reader_get_message_list (reader);
@@ -1798,7 +1814,9 @@ mail_reader_message_read_cb (EMailReader *reader)
uid = g_object_get_data (G_OBJECT (reader), "mark-read-uid");
g_return_val_if_fail (uid != NULL, FALSE);
- if (g_strcmp0 (message_list->cursor_uid, uid) == 0)
+ cursor_uid = MESSAGE_LIST (message_list)->cursor_uid;
+
+ if (g_strcmp0 (cursor_uid, uid) == 0)
e_mail_reader_mark_as_read (reader, uid);
return FALSE;
@@ -1813,12 +1831,13 @@ mail_reader_message_loaded_cb (CamelFolder *folder,
{
EMailReader *reader = user_data;
EMFormatHTMLDisplay *html_display;
- MessageList *message_list;
+ GtkWidget *message_list;
EShellBackend *shell_backend;
EShellSettings *shell_settings;
EShell *shell;
EMEvent *event;
EMEventTargetMessage *target;
+ const gchar *cursor_uid;
gboolean mark_read;
gint timeout_interval;
@@ -1829,9 +1848,11 @@ mail_reader_message_loaded_cb (CamelFolder *folder,
shell = e_shell_backend_get_shell (shell_backend);
shell_settings = e_shell_get_shell_settings (shell);
+ cursor_uid = MESSAGE_LIST (message_list)->cursor_uid;
+
/* If the user picked a different message in the time it took
* to fetch this message, then don't bother rendering it. */
- if (g_strcmp0 (message_list->cursor_uid, message_uid) != 0)
+ if (g_strcmp0 (cursor_uid, message_uid) != 0)
return;
/** @Event: message.reading
@@ -1863,11 +1884,11 @@ mail_reader_message_loaded_cb (CamelFolder *folder,
G_OBJECT (reader), "mark-read-uid",
g_strdup (message_uid), (GDestroyNotify) g_free);
- if (message_list->seen_id > 0)
- g_source_remove (message_list->seen_id);
+ if (MESSAGE_LIST (message_list)->seen_id > 0)
+ g_source_remove (MESSAGE_LIST (message_list)->seen_id);
if (message != NULL && mark_read) {
- message_list->seen_id = g_timeout_add (
+ MESSAGE_LIST (message_list)->seen_id = g_timeout_add (
timeout_interval, (GSourceFunc)
mail_reader_message_read_cb, reader);
@@ -1896,7 +1917,7 @@ static gboolean
mail_reader_message_selected_timeout_cb (EMailReader *reader)
{
EMFormatHTMLDisplay *html_display;
- MessageList *message_list;
+ GtkWidget *message_list;
const gchar *cursor_uid;
const gchar *format_uid;
const gchar *key;
@@ -1904,10 +1925,10 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader)
html_display = e_mail_reader_get_html_display (reader);
message_list = e_mail_reader_get_message_list (reader);
- cursor_uid = message_list->cursor_uid;
+ cursor_uid = MESSAGE_LIST (message_list)->cursor_uid;
format_uid = EM_FORMAT (html_display)->uid;
- if (message_list->last_sel_single) {
+ if (MESSAGE_LIST (message_list)->last_sel_single) {
GtkWidget *widget;
gboolean html_display_visible;
gboolean selected_uid_changed;
@@ -1923,12 +1944,16 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader)
gint op_id;
op_id = mail_get_messagex (
- message_list->folder, cursor_uid,
+ MESSAGE_LIST (message_list)->folder,
+ cursor_uid,
mail_reader_message_loaded_cb,
g_object_ref (reader),
mail_msg_fast_ordered_push);
- g_object_set_data (G_OBJECT (reader), "preview-get-message-op-id", GINT_TO_POINTER (op_id));
+ g_object_set_data (
+ G_OBJECT (reader),
+ "preview-get-message-op-id",
+ GINT_TO_POINTER (op_id));
}
} else
em_format_format (EM_FORMAT (html_display), NULL, NULL, NULL);
@@ -1945,12 +1970,13 @@ mail_reader_message_selected_cb (EMailReader *reader,
{
GSource *source;
const gchar *key;
- gint op_id;
+ gpointer data;
- /* cancel previous message fetching, if any, first */
- op_id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (reader), "preview-get-message-op-id"));
- if (op_id)
- mail_msg_cancel (op_id);
+ /* First cancel any previous message fetching. */
+ key = "preview-get-message-op-id";
+ data = g_object_get_data (G_OBJECT (reader), key);
+ if (data != NULL)
+ mail_msg_cancel (GPOINTER_TO_INT (data));
/* XXX This is kludgy, but we have no other place to store timeout
* state information. Addendum: See EAttachmentView for an example
@@ -1987,17 +2013,18 @@ mail_reader_set_folder (EMailReader *reader,
const gchar *folder_uri)
{
EMFormatHTMLDisplay *html_display;
- MessageList *message_list;
+ GtkWidget *message_list;
gboolean outgoing;
html_display = e_mail_reader_get_html_display (reader);
message_list = e_mail_reader_get_message_list (reader);
- if (message_list->folder != NULL)
- mail_sync_folder (message_list->folder, NULL, NULL);
+ if (MESSAGE_LIST (message_list)->folder != NULL)
+ mail_sync_folder (
+ MESSAGE_LIST (message_list)->folder, NULL, NULL);
/* Skip the rest if we're already viewing the folder. */
- if (g_strcmp0 (folder_uri, message_list->folder_uri) == 0)
+ if (g_strcmp0 (folder_uri, MESSAGE_LIST (message_list)->folder_uri) == 0)
return;
outgoing = folder != NULL && folder_uri != NULL && (
@@ -2006,7 +2033,9 @@ mail_reader_set_folder (EMailReader *reader,
em_utils_folder_is_sent (folder, folder_uri));
em_format_format (EM_FORMAT (html_display), NULL, NULL, NULL);
- message_list_set_folder (message_list, folder, folder_uri, outgoing);
+
+ message_list_set_folder (
+ MESSAGE_LIST (message_list), folder, folder_uri, outgoing);
mail_reader_emit_folder_loaded (reader);
}
@@ -2015,10 +2044,11 @@ static void
mail_reader_set_message (EMailReader *reader,
const gchar *uid)
{
- MessageList *message_list;
+ GtkWidget *message_list;
message_list = e_mail_reader_get_message_list (reader);
- message_list_select_uid (message_list, uid);
+
+ message_list_select_uid (MESSAGE_LIST (message_list), uid);
}
static void
@@ -2463,7 +2493,7 @@ e_mail_reader_init (EMailReader *reader)
EMenuToolAction *menu_tool_action;
EWebView *web_view;
GtkActionGroup *action_group;
- MessageList *message_list;
+ GtkWidget *message_list;
GConfBridge *bridge;
GtkAction *action;
const gchar *action_name;
@@ -2620,15 +2650,15 @@ e_mail_reader_init (EMailReader *reader)
G_CALLBACK (mail_reader_emit_folder_loaded), reader);
g_signal_connect_swapped (
- message_list->tree, "double-click",
+ MESSAGE_LIST (message_list)->tree, "double-click",
G_CALLBACK (mail_reader_double_click_cb), reader);
g_signal_connect_swapped (
- message_list->tree, "key-press",
+ MESSAGE_LIST (message_list)->tree, "key-press",
G_CALLBACK (mail_reader_key_press_cb), reader);
g_signal_connect_swapped (
- message_list->tree, "selection-change",
+ MESSAGE_LIST (message_list)->tree, "selection-change",
G_CALLBACK (e_mail_reader_changed), reader);
}
@@ -2643,7 +2673,7 @@ e_mail_reader_changed (EMailReader *reader)
guint32
e_mail_reader_check_state (EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
GPtrArray *uids;
CamelFolder *folder;
CamelStore *store = NULL;
@@ -2669,9 +2699,9 @@ e_mail_reader_check_state (EMailReader *reader)
g_return_val_if_fail (E_IS_MAIL_READER (reader), 0);
message_list = e_mail_reader_get_message_list (reader);
- uids = message_list_get_selected (message_list);
- folder_uri = message_list->folder_uri;
- folder = message_list->folder;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
+ folder = MESSAGE_LIST (message_list)->folder;
if (folder != NULL) {
store = CAMEL_STORE (folder->parent_store);
@@ -2865,7 +2895,7 @@ e_mail_reader_get_html_display (EMailReader *reader)
return iface->get_html_display (reader);
}
-MessageList *
+GtkWidget *
e_mail_reader_get_message_list (EMailReader *reader)
{
EMailReaderIface *iface;
diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h
index e9f9a3a9e4..122d11fb88 100644
--- a/mail/e-mail-reader.h
+++ b/mail/e-mail-reader.h
@@ -22,10 +22,16 @@
#ifndef E_MAIL_READER_H
#define E_MAIL_READER_H
+/* XXX Anjal uses a different message list widget than Evolution, so
+ * avoid including <mail/message-list.h> in this file. This makes
+ * the get_message_list() method a little awkward since it returns
+ * a GtkWidget pointer which almost always has to be type casted.
+ * Consider adding get_folder() and get_folder_uri() methods to
+ * take some pressure off get_message_list(). */
+
#include <gtk/gtk.h>
#include <camel/camel-folder.h>
#include <mail/em-format-html-display.h>
-#include <mail/message-list.h>
#include <shell/e-shell-backend.h>
/* Standard GObject macros */
@@ -82,7 +88,7 @@ struct _EMailReaderIface {
gboolean (*get_hide_deleted) (EMailReader *reader);
EMFormatHTMLDisplay *
(*get_html_display) (EMailReader *reader);
- MessageList * (*get_message_list) (EMailReader *reader);
+ GtkWidget * (*get_message_list) (EMailReader *reader);
GtkMenu * (*get_popup_menu) (EMailReader *reader);
EShellBackend * (*get_shell_backend) (EMailReader *reader);
GtkWindow * (*get_window) (EMailReader *reader);
@@ -110,7 +116,7 @@ GtkActionGroup *
gboolean e_mail_reader_get_hide_deleted (EMailReader *reader);
EMFormatHTMLDisplay *
e_mail_reader_get_html_display (EMailReader *reader);
-MessageList * e_mail_reader_get_message_list (EMailReader *reader);
+GtkWidget * e_mail_reader_get_message_list (EMailReader *reader);
GtkMenu * e_mail_reader_get_popup_menu (EMailReader *reader);
EShellBackend * e_mail_reader_get_shell_backend (EMailReader *reader);
GtkWindow * e_mail_reader_get_window (EMailReader *reader);
diff --git a/mail/e-mail-store.c b/mail/e-mail-store.c
index 1fc3eb5b25..749459d462 100644
--- a/mail/e-mail-store.c
+++ b/mail/e-mail-store.c
@@ -264,9 +264,13 @@ e_mail_store_init (const gchar *data_dir)
{
static gboolean initialized = FALSE;
- g_return_if_fail (!initialized);
g_return_if_fail (data_dir != NULL);
+ /* This function is idempotent, but there should
+ * be no need to call it more than once. */
+ if (initialized)
+ return;
+
/* Initialize global variables. */
store_table = g_hash_table_new_full (
diff --git a/mail/em-utils.c b/mail/em-utils.c
index cb8ebc3306..1238fcf2e5 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -79,6 +79,10 @@
#include "em-format-quote.h"
#include "e-mail-local.h"
+/* XXX This is a dirty hack on a dirty hack. We really need
+ * to rework or get rid of the functions that use this. */
+extern const gchar *shell_builtin_backend;
+
/* How many is too many? */
/* Used in em_util_ask_open_many() */
#define TOO_MANY 10
@@ -97,7 +101,8 @@ em_utils_get_data_dir (void)
* better way. Ideally, nothing below the module layer
* should need to know about the user data directory. */
shell = e_shell_get_default ();
- shell_backend = e_shell_get_backend_by_name (shell, "mail");
+ shell_backend = e_shell_get_backend_by_name (
+ shell, shell_builtin_backend);
return e_shell_backend_get_data_dir (shell_backend);
}
@@ -112,7 +117,8 @@ em_utils_get_config_dir (void)
* better way. Ideally, nothing below the module layer
* should need to know about the user config directory. */
shell = e_shell_get_default ();
- shell_backend = e_shell_get_backend_by_name (shell, "mail");
+ shell_backend = e_shell_get_backend_by_name (
+ shell, shell_builtin_backend);
return e_shell_backend_get_config_dir (shell_backend);
}
@@ -2074,7 +2080,8 @@ em_utils_show_error_silent (GtkWidget *widget)
EActivity *activity;
shell = e_shell_get_default ();
- shell_backend = e_shell_get_backend_by_name (shell, "mail");
+ shell_backend = e_shell_get_backend_by_name (
+ shell, shell_builtin_backend);
activity = e_alert_activity_new_warning (widget);
e_shell_backend_add_activity (shell_backend, activity);
@@ -2094,7 +2101,8 @@ em_utils_show_info_silent (GtkWidget *widget)
EActivity *activity;
shell = e_shell_get_default ();
- shell_backend = e_shell_get_backend_by_name (shell, "mail");
+ shell_backend = e_shell_get_backend_by_name (
+ shell, shell_builtin_backend);
activity = e_alert_activity_new_info (widget);
e_shell_backend_add_activity (shell_backend, activity);
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index ff7a30e97c..2c06561770 100644
--- a/mail/mail-mt.c
+++ b/mail/mail-mt.c
@@ -46,6 +46,10 @@
/*#define MALLOC_CHECK*/
#define d(x)
+/* XXX This is a dirty hack on a dirty hack. We really need
+ * to rework or get rid of the functions that use this. */
+const gchar *shell_builtin_backend = "mail";
+
static void mail_operation_status(CamelOperation *op, const gchar *what, gint pc, gpointer data);
/* background operation status stuff */
@@ -96,7 +100,8 @@ end_event_callback (CamelObject *o, EActivity *activity, gpointer error)
EShellBackend *shell_backend;
shell = e_shell_get_default ();
- shell_backend = e_shell_get_backend_by_name (shell, "mail");
+ shell_backend = e_shell_get_backend_by_name (
+ shell, shell_builtin_backend);
if (activity != NULL) {
e_activity_complete (activity);
@@ -846,7 +851,8 @@ op_status_exec (struct _op_status_msg *m)
g_return_if_fail (mail_in_main_thread ());
shell = e_shell_get_default ();
- shell_backend = e_shell_get_backend_by_name (shell, "mail");
+ shell_backend = e_shell_get_backend_by_name (
+ shell, shell_builtin_backend);
g_mutex_lock (mail_msg_lock);
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 1495f09ed4..b5e135c227 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -348,7 +348,7 @@ static gchar *
format_url (const gchar *internal_url, const gchar *account_name)
{
CamelURL *url;
- gchar *pretty_url;
+ gchar *pretty_url = NULL;
url = camel_url_new(internal_url, NULL);
if (account_name) {
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c
index 465022a48f..fb4a6ab4fb 100644
--- a/modules/mail/e-mail-shell-content.c
+++ b/modules/mail/e-mail-shell-content.c
@@ -35,6 +35,7 @@
#include "em-utils.h"
#include "mail-config.h"
#include "mail-ops.h"
+#include "message-list.h"
#include "e-mail-reader.h"
#include "e-mail-search-bar.h"
diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c
index d182f98426..fa0acd1f5a 100644
--- a/modules/mail/e-mail-shell-sidebar.c
+++ b/modules/mail/e-mail-shell-sidebar.c
@@ -365,29 +365,6 @@ mail_shell_sidebar_selection_changed_cb (EShellSidebar *shell_sidebar,
}
static void
-tree_hidden_key_event_cb (EMFolderTree *emft, GdkEvent *event, EShellView *shell_view)
-{
- if (event && event->type == GDK_KEY_PRESS && shell_view) {
- MessageList *msg_list = e_mail_reader_get_message_list (E_MAIL_READER (e_shell_view_get_shell_content (shell_view)));
-
- g_return_if_fail (msg_list != NULL);
-
- switch (event->key.keyval) {
- case '[':
- case ',':
- gtk_widget_grab_focus ((GtkWidget *) msg_list);
- message_list_select (msg_list, MESSAGE_LIST_SELECT_PREVIOUS|MESSAGE_LIST_SELECT_WRAP, 0, CAMEL_MESSAGE_SEEN);
- break;
- case ']':
- case '.':
- gtk_widget_grab_focus ((GtkWidget *) msg_list);
- message_list_select (msg_list, MESSAGE_LIST_SELECT_NEXT|MESSAGE_LIST_SELECT_WRAP, 0, CAMEL_MESSAGE_SEEN);
- break;
- }
- }
-}
-
-static void
mail_shell_sidebar_get_property (GObject *object,
guint property_id,
GValue *value,
@@ -484,8 +461,6 @@ mail_shell_sidebar_constructed (GObject *object)
shell_settings, "mail-side-bar-search",
widget, "enable-search");
- g_signal_connect (widget, "hidden-key-event", G_CALLBACK (tree_hidden_key_event_cb), shell_view);
-
tree_view = GTK_TREE_VIEW (mail_shell_sidebar->priv->folder_tree);
selection = gtk_tree_view_get_selection (tree_view);
model = gtk_tree_view_get_model (tree_view);
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index 4dce2de80b..d9785a9cdf 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -83,7 +83,7 @@ action_mail_create_search_folder_cb (GtkAction *action,
EMailReader *reader;
EShellView *shell_view;
EShellContent *shell_content;
- MessageList *message_list;
+ GtkWidget *message_list;
EFilterRule *search_rule;
EMVFolderRule *vfolder_rule;
const gchar *folder_uri;
@@ -104,7 +104,7 @@ action_mail_create_search_folder_cb (GtkAction *action,
reader = E_MAIL_READER (shell_content);
message_list = e_mail_reader_get_message_list (reader);
- folder_uri = message_list->folder_uri;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
search_rule = vfolder_clone_rule (search_rule);
rule_name = g_strdup_printf ("%s %s", search_rule->name, search_text);
@@ -195,19 +195,21 @@ action_mail_folder_expunge_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
EShellWindow *shell_window;
EShellView *shell_view;
+ CamelFolder *folder;
shell_view = E_SHELL_VIEW (mail_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- g_return_if_fail (message_list->folder != NULL);
- em_utils_expunge_folder (
- GTK_WIDGET (shell_window), message_list->folder);
+ folder = MESSAGE_LIST (message_list)->folder;
+ g_return_if_fail (folder != NULL);
+
+ em_utils_expunge_folder (GTK_WIDGET (shell_window), folder);
}
static void
@@ -215,7 +217,7 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
EShellWindow *shell_window;
EShellView *shell_view;
CamelFolder *folder;
@@ -231,7 +233,8 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action,
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
+
+ folder = MESSAGE_LIST (message_list)->folder;
g_return_if_fail (folder != NULL);
key = "/apps/evolution/mail/prompts/mark_all_read";
@@ -240,7 +243,7 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action,
if (!em_utils_prompt_user (parent, key, prompt, NULL))
return;
- uids = message_list_get_uids (message_list);
+ uids = message_list_get_uids (MESSAGE_LIST (message_list));
camel_folder_freeze (folder);
for (ii = 0; ii < uids->len; ii++)
@@ -249,7 +252,7 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action,
CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
camel_folder_thaw (folder);
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
}
static void
@@ -356,10 +359,10 @@ action_mail_folder_rename_cb (GtkAction *action,
/* Helper for action_mail_folder_select_all_cb() */
static gboolean
-action_mail_folder_select_all_timeout_cb (MessageList *message_list)
+action_mail_folder_select_all_timeout_cb (GtkWidget *message_list)
{
- message_list_select_all (message_list);
- gtk_widget_grab_focus (GTK_WIDGET (message_list));
+ message_list_select_all (MESSAGE_LIST (message_list));
+ gtk_widget_grab_focus (message_list);
return FALSE;
}
@@ -369,7 +372,7 @@ action_mail_folder_select_all_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
EShellWindow *shell_window;
EShellView *shell_view;
@@ -379,7 +382,7 @@ action_mail_folder_select_all_cb (GtkAction *action,
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- if (message_list->threaded) {
+ if (MESSAGE_LIST (message_list)->threaded) {
gtk_action_activate (ACTION (MAIL_THREADS_EXPAND_ALL));
/* XXX The timeout below is added so that the execution
@@ -400,26 +403,26 @@ static void
action_mail_folder_select_thread_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- MessageList *message_list;
+ GtkWidget *message_list;
EMailReader *reader;
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- message_list_select_thread (message_list);
+ message_list_select_thread (MESSAGE_LIST (message_list));
}
static void
action_mail_folder_select_subthread_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- MessageList *message_list;
+ GtkWidget *message_list;
EMailReader *reader;
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- message_list_select_subthread (message_list);
+ message_list_select_subthread (MESSAGE_LIST (message_list));
}
static void
@@ -442,7 +445,7 @@ static void
action_mail_hide_deleted_cb (GtkToggleAction *action,
EMailShellView *mail_shell_view)
{
- MessageList *message_list;
+ GtkWidget *message_list;
EMailReader *reader;
gboolean active;
@@ -450,21 +453,21 @@ action_mail_hide_deleted_cb (GtkToggleAction *action,
message_list = e_mail_reader_get_message_list (reader);
active = gtk_toggle_action_get_active (action);
- message_list_set_hidedeleted (message_list, active);
+ message_list_set_hidedeleted (MESSAGE_LIST (message_list), active);
}
static void
action_mail_hide_read_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- MessageList *message_list;
+ GtkWidget *message_list;
EMailReader *reader;
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
message_list_hide_add (
- message_list,
+ MESSAGE_LIST (message_list),
"(match-all (system-flag \"seen\"))",
ML_HIDE_SAME, ML_HIDE_SAME);
}
@@ -473,16 +476,16 @@ static void
action_mail_hide_selected_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- MessageList *message_list;
+ GtkWidget *message_list;
EMailReader *reader;
GPtrArray *uids;
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- uids = message_list_get_selected (message_list);
- message_list_hide_uids (message_list, uids);
- message_list_free_uids (message_list, uids);
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
+ message_list_hide_uids (MESSAGE_LIST (message_list), uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
}
static void
@@ -490,7 +493,7 @@ action_mail_label_cb (GtkToggleAction *action,
EMailShellView *mail_shell_view)
{
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GPtrArray *uids;
const gchar *tag;
@@ -501,9 +504,9 @@ action_mail_label_cb (GtkToggleAction *action,
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
+ folder = MESSAGE_LIST (message_list)->folder;
- uids = message_list_get_selected (message_list);
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
for (ii = 0; ii < uids->len; ii++) {
if (gtk_toggle_action_get_active (action))
@@ -517,7 +520,7 @@ action_mail_label_cb (GtkToggleAction *action,
}
}
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
}
static void
@@ -531,7 +534,7 @@ action_mail_label_new_cb (GtkAction *action,
EMailLabelDialog *label_dialog;
EMailLabelListStore *store;
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GtkTreeModel *model;
GtkTreeIter iter;
@@ -578,15 +581,15 @@ action_mail_label_new_cb (GtkAction *action,
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
for (ii = 0; ii < uids->len; ii++)
camel_folder_set_message_user_flag (
folder, uids->pdata[ii], label_tag, TRUE);
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
g_free (label_tag);
@@ -603,7 +606,7 @@ action_mail_label_none_cb (GtkAction *action,
EShellSettings *shell_settings;
EShellWindow *shell_window;
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
GtkTreeModel *tree_model;
CamelFolder *folder;
GtkTreeIter iter;
@@ -621,8 +624,8 @@ action_mail_label_none_cb (GtkAction *action,
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- uids = message_list_get_selected (message_list);
- folder = message_list->folder;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
+ folder = MESSAGE_LIST (message_list)->folder;
valid = gtk_tree_model_get_iter_first (tree_model, &iter);
@@ -644,20 +647,20 @@ action_mail_label_none_cb (GtkAction *action,
valid = gtk_tree_model_iter_next (tree_model, &iter);
}
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
}
static void
action_mail_show_hidden_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- MessageList *message_list;
+ GtkWidget *message_list;
EMailReader *reader;
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- message_list_hide_clear (message_list);
+ message_list_hide_clear (MESSAGE_LIST (message_list));
}
static void
@@ -672,7 +675,7 @@ action_mail_smart_backward_cb (GtkAction *action,
EMFolderTree *folder_tree;
EMFormatHTMLDisplay *html_display;
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
GtkToggleAction *toggle_action;
GtkHTML *html;
gboolean caret_mode;
@@ -709,18 +712,21 @@ action_mail_smart_backward_cb (GtkAction *action,
/* XXX Are two separate calls really necessary? */
if (message_list_select (
- message_list, MESSAGE_LIST_SELECT_PREVIOUS,
+ MESSAGE_LIST (message_list),
+ MESSAGE_LIST_SELECT_PREVIOUS,
0, CAMEL_MESSAGE_SEEN))
return;
if (message_list_select (
- message_list, MESSAGE_LIST_SELECT_PREVIOUS |
- MESSAGE_LIST_SELECT_WRAP, 0, CAMEL_MESSAGE_SEEN))
+ MESSAGE_LIST (message_list),
+ MESSAGE_LIST_SELECT_PREVIOUS |
+ MESSAGE_LIST_SELECT_WRAP, 0,
+ CAMEL_MESSAGE_SEEN))
return;
em_folder_tree_select_prev_path (folder_tree, TRUE);
- gtk_widget_grab_focus (GTK_WIDGET (message_list));
+ gtk_widget_grab_focus (message_list);
}
static void
@@ -735,7 +741,7 @@ action_mail_smart_forward_cb (GtkAction *action,
EMFolderTree *folder_tree;
EMFormatHTMLDisplay *html_display;
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
GtkToggleAction *toggle_action;
GtkHTML *html;
gboolean caret_mode;
@@ -772,18 +778,21 @@ action_mail_smart_forward_cb (GtkAction *action,
/* XXX Are two separate calls really necessary? */
if (message_list_select (
- message_list, MESSAGE_LIST_SELECT_NEXT,
+ MESSAGE_LIST (message_list),
+ MESSAGE_LIST_SELECT_NEXT,
0, CAMEL_MESSAGE_SEEN))
return;
if (message_list_select (
- message_list, MESSAGE_LIST_SELECT_NEXT |
- MESSAGE_LIST_SELECT_WRAP, 0, CAMEL_MESSAGE_SEEN))
+ MESSAGE_LIST (message_list),
+ MESSAGE_LIST_SELECT_NEXT |
+ MESSAGE_LIST_SELECT_WRAP,
+ 0, CAMEL_MESSAGE_SEEN))
return;
em_folder_tree_select_next_path (folder_tree, TRUE);
- gtk_widget_grab_focus (GTK_WIDGET (message_list));
+ gtk_widget_grab_focus (message_list);
}
static void
@@ -797,26 +806,26 @@ static void
action_mail_threads_collapse_all_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- MessageList *message_list;
+ GtkWidget *message_list;
EMailReader *reader;
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- message_list_set_threaded_collapse_all (message_list);
+ message_list_set_threaded_collapse_all (MESSAGE_LIST (message_list));
}
static void
action_mail_threads_expand_all_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- MessageList *message_list;
+ GtkWidget *message_list;
EMailReader *reader;
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- message_list_set_threaded_expand_all (message_list);
+ message_list_set_threaded_expand_all (MESSAGE_LIST (message_list));
}
static void
@@ -824,7 +833,7 @@ action_mail_threads_group_by_cb (GtkToggleAction *action,
EMailShellView *mail_shell_view)
{
EMailShellContent *mail_shell_content;
- MessageList *message_list;
+ GtkWidget *message_list;
EMailReader *reader;
gboolean active;
@@ -834,7 +843,7 @@ action_mail_threads_group_by_cb (GtkToggleAction *action,
reader = E_MAIL_READER (mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- message_list_set_threaded (message_list, active);
+ message_list_set_threaded (MESSAGE_LIST (message_list), active);
}
static void
@@ -909,7 +918,7 @@ action_search_filter_cb (GtkRadioAction *action,
EShellContent *shell_content;
EShellWindow *shell_window;
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
GKeyFile *key_file;
const gchar *folder_uri;
@@ -919,7 +928,7 @@ action_search_filter_cb (GtkRadioAction *action,
reader = E_MAIL_READER (shell_content);
message_list = e_mail_reader_get_message_list (reader);
- folder_uri = message_list->folder_uri;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
if (folder_uri != NULL) {
const gchar *key;
@@ -947,7 +956,7 @@ action_search_scope_cb (GtkRadioAction *action,
EShellContent *shell_content;
EShellWindow *shell_window;
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
GKeyFile *key_file;
const gchar *folder_uri;
@@ -957,7 +966,7 @@ action_search_scope_cb (GtkRadioAction *action,
reader = E_MAIL_READER (shell_content);
message_list = e_mail_reader_get_message_list (reader);
- folder_uri = message_list->folder_uri;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
if (folder_uri != NULL) {
const gchar *key;
@@ -1651,7 +1660,7 @@ e_mail_shell_view_update_popup_labels (EMailShellView *mail_shell_view)
EShellWindow *shell_window;
EShellView *shell_view;
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
GtkUIManager *ui_manager;
GtkActionGroup *action_group;
GtkTreeModel *tree_model;
@@ -1684,7 +1693,7 @@ e_mail_shell_view_update_popup_labels (EMailShellView *mail_shell_view)
reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
message_list = e_mail_reader_get_message_list (reader);
- uids = message_list_get_selected (message_list);
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
valid = gtk_tree_model_get_iter_first (tree_model, &iter);
@@ -1715,7 +1724,7 @@ e_mail_shell_view_update_popup_labels (EMailShellView *mail_shell_view)
/* Configure the action before we connect to signals. */
mail_shell_view_update_label_action (
GTK_TOGGLE_ACTION (label_action),
- message_list, uids, tag);
+ MESSAGE_LIST (message_list), uids, tag);
g_signal_connect (
label_action, "toggled",
@@ -1738,7 +1747,7 @@ e_mail_shell_view_update_popup_labels (EMailShellView *mail_shell_view)
ii++;
}
- message_list_free_uids (message_list, uids);
+ message_list_free_uids (MESSAGE_LIST (message_list), uids);
g_object_unref (tree_model);
}
diff --git a/modules/mail/e-mail-shell-view-private.h b/modules/mail/e-mail-shell-view-private.h
index 70700dddfc..dac7d81ca0 100644
--- a/modules/mail/e-mail-shell-view-private.h
+++ b/modules/mail/e-mail-shell-view-private.h
@@ -57,6 +57,7 @@
#include "mail-ops.h"
#include "mail-send-recv.h"
#include "mail-vfolder.h"
+#include "message-list.h"
#include "e-mail-shell-backend.h"
#include "e-mail-shell-content.h"
diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c
index c18b3e68b0..7cd7bdfaf4 100644
--- a/modules/mail/e-mail-shell-view.c
+++ b/modules/mail/e-mail-shell-view.c
@@ -93,7 +93,7 @@ mail_shell_view_execute_search (EShellView *shell_view)
EShellSettings *shell_settings;
EMFormatHTMLDisplay *html_display;
EMailShellContent *mail_shell_content;
- MessageList *message_list;
+ GtkWidget *message_list;
EFilterRule *rule;
EMailReader *reader;
CamelFolder *folder;
@@ -126,8 +126,8 @@ mail_shell_view_execute_search (EShellView *shell_view)
html_display = e_mail_reader_get_html_display (reader);
message_list = e_mail_reader_get_message_list (reader);
- folder_uri = message_list->folder_uri;
- folder = message_list->folder;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
+ folder = MESSAGE_LIST (message_list)->folder;
if (folder_uri != NULL) {
GKeyFile *key_file;
@@ -346,7 +346,7 @@ filter:
break;
}
- message_list_set_search (message_list, query);
+ message_list_set_search (MESSAGE_LIST (message_list), query);
e_mail_shell_content_set_search_strings (
mail_shell_content, search_strings);
@@ -464,7 +464,11 @@ mail_shell_view_update_actions (EShellView *shell_view)
uri = em_folder_tree_get_selected_uri (folder_tree);
if (uri != NULL) {
EMFolderTreeModel *model;
- MessageList *message_list;
+ GtkWidget *message_list;
+ const gchar *folder_uri;
+
+ message_list = e_mail_reader_get_message_list (reader);
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
/* XXX If the user right-clicks on a folder other than what
* the message list is showing, disable folder rename.
@@ -473,9 +477,8 @@ mail_shell_view_update_actions (EShellView *shell_view)
* back to where it was to avoid cancelling the inline
* folder tree editing, it's just too hairy to try to
* get right. So we're punting. */
- message_list = e_mail_reader_get_message_list (reader);
folder_tree_and_message_list_agree =
- (g_strcmp0 (uri, message_list->folder_uri) == 0);
+ (g_strcmp0 (uri, folder_uri) == 0);
account = mail_config_get_account_by_source_url (uri);
diff --git a/plugins/groupwise-features/gw-ui.c b/plugins/groupwise-features/gw-ui.c
index f026311841..6a79cd3b0f 100644
--- a/plugins/groupwise-features/gw-ui.c
+++ b/plugins/groupwise-features/gw-ui.c
@@ -26,6 +26,7 @@
#include <mail/e-mail-reader.h>
#include <mail/em-folder-tree.h>
#include <mail/em-folder-tree-model.h>
+#include <mail/message-list.h>
#include <calendar/gui/e-calendar-view.h>
#include <calendar/gui/gnome-cal.h>
@@ -202,19 +203,19 @@ update_mmp_entries_cb (EShellView *shell_view, gpointer user_data)
if (visible) {
EShellContent *shell_content;
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
GPtrArray *selected;
shell_content = e_shell_view_get_shell_content (shell_view);
reader = (EMailReader *) (shell_content);
message_list = e_mail_reader_get_message_list (reader);
- selected = message_list_get_selected (message_list);
+ selected = message_list_get_selected (MESSAGE_LIST (message_list));
if (selected)
n_selected = selected->len;
- message_list_free_uids (message_list, selected);
+ message_list_free_uids (MESSAGE_LIST (message_list), selected);
visible = n_selected > 0;
}
diff --git a/plugins/groupwise-features/junk-mail-settings.c b/plugins/groupwise-features/junk-mail-settings.c
index fe82ccb4d5..4fc4b735c0 100644
--- a/plugins/groupwise-features/junk-mail-settings.c
+++ b/plugins/groupwise-features/junk-mail-settings.c
@@ -30,6 +30,7 @@
#include <gtk/gtk.h>
#include <mail/e-mail-reader.h>
+#include <mail/message-list.h>
#include <e-gw-connection.h>
@@ -67,16 +68,16 @@ gw_junk_mail_settings_cb (GtkAction *action, EShellView *shell_view)
gchar *msg;
EShellContent *shell_content;
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
shell_content = e_shell_view_get_shell_content (shell_view);
reader = (EMailReader *) (shell_content);
message_list = e_mail_reader_get_message_list (reader);
g_return_if_fail (message_list != NULL);
- g_return_if_fail (message_list->folder != NULL);
+ g_return_if_fail (MESSAGE_LIST (message_list)->folder != NULL);
- cnc = get_cnc (message_list->folder->parent_store);
+ cnc = get_cnc (MESSAGE_LIST (message_list)->folder->parent_store);
dialog = gtk_dialog_new_with_buttons (_("Junk Settings"),
NULL,
diff --git a/plugins/groupwise-features/mail-retract.c b/plugins/groupwise-features/mail-retract.c
index 70b79d7c80..01bf11c6fe 100644
--- a/plugins/groupwise-features/mail-retract.c
+++ b/plugins/groupwise-features/mail-retract.c
@@ -32,6 +32,7 @@
#include <e-util/e-alert.h>
#include <mail/e-mail-reader.h>
+#include <mail/message-list.h>
#include "gw-ui.h"
#include "share-folder.h"
@@ -41,7 +42,7 @@ get_selected_info (EShellView *shell_view, CamelFolder **folder, gchar **selecte
{
EShellContent *shell_content;
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
GPtrArray *selected;
shell_content = e_shell_view_get_shell_content (shell_view);
@@ -50,13 +51,13 @@ get_selected_info (EShellView *shell_view, CamelFolder **folder, gchar **selecte
message_list = e_mail_reader_get_message_list (reader);
g_return_val_if_fail (message_list != NULL, FALSE);
- selected = message_list_get_selected (message_list);
+ selected = message_list_get_selected (MESSAGE_LIST (message_list));
if (selected && selected->len == 1) {
- *folder = message_list->folder;
+ *folder = MESSAGE_LIST (message_list)->folder;
*selected_uid = g_strdup (g_ptr_array_index (selected, 0));
}
- message_list_free_uids (message_list, selected);
+ message_list_free_uids (MESSAGE_LIST (message_list), selected);
return *selected_uid != NULL;
}
diff --git a/plugins/groupwise-features/status-track.c b/plugins/groupwise-features/status-track.c
index e38497823b..45d0a206c6 100644
--- a/plugins/groupwise-features/status-track.c
+++ b/plugins/groupwise-features/status-track.c
@@ -38,6 +38,7 @@
#include <camel/camel-mime-message.h>
#include <mail/e-mail-reader.h>
+#include <mail/message-list.h>
#include <e-gw-connection.h>
@@ -63,7 +64,7 @@ get_selected_message (EShellView *shell_view, CamelFolder **folder, gchar **sele
CamelMimeMessage *msg = NULL;
EShellContent *shell_content;
EMailReader *reader;
- MessageList *message_list;
+ GtkWidget *message_list;
GPtrArray *selected;
shell_content = e_shell_view_get_shell_content (shell_view);
@@ -72,15 +73,15 @@ get_selected_message (EShellView *shell_view, CamelFolder **folder, gchar **sele
message_list = e_mail_reader_get_message_list (reader);
g_return_val_if_fail (message_list != NULL, NULL);
- selected = message_list_get_selected (message_list);
+ selected = message_list_get_selected (MESSAGE_LIST (message_list));
if (selected && selected->len == 1) {
- *folder = message_list->folder;
+ *folder = MESSAGE_LIST (message_list)->folder;
*selected_uid = g_strdup (g_ptr_array_index (selected, 0));
msg = camel_folder_get_message (*folder, *selected_uid, NULL);
}
- message_list_free_uids (message_list, selected);
+ message_list_free_uids (MESSAGE_LIST (message_list), selected);
return msg;
}
diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c
index a90731e2fc..6b79b78e94 100644
--- a/plugins/mail-to-task/mail-to-task.c
+++ b/plugins/mail-to-task/mail-to-task.c
@@ -50,6 +50,7 @@
#include <mail/em-utils.h>
#include <mail/em-format-html.h>
#include <mail/mail-config.h>
+#include <mail/message-list.h>
#include <e-util/e-account-utils.h>
#include <e-util/e-dialog-utils.h>
#include <calendar/common/authentication.h>
@@ -925,7 +926,7 @@ mail_to_event (ECalSourceType source_type,
gboolean with_attendees,
EMailReader *reader)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GPtrArray *selected;
ESourceList *source_list = NULL;
@@ -935,8 +936,8 @@ mail_to_event (ECalSourceType source_type,
GError *error = NULL;
message_list = e_mail_reader_get_message_list (reader);
- selected = message_list_get_selected (message_list);
- folder = message_list->folder;
+ selected = message_list_get_selected (MESSAGE_LIST (message_list));
+ folder = MESSAGE_LIST (message_list)->folder;
if (!e_cal_get_sources (&source_list, source_type, &error)) {
e_notice (NULL, GTK_MESSAGE_ERROR, _("Cannot get source list. %s"), error ? error->message : _("Unknown error."));
diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c
index c665f33227..006215bf3f 100644
--- a/plugins/mailing-list-actions/mailing-list-actions.c
+++ b/plugins/mailing-list-actions/mailing-list-actions.c
@@ -44,6 +44,7 @@
#include "mail/mail-ops.h"
#include "mail/mail-mt.h"
#include "mail/mail-config.h"
+#include "mail/message-list.h"
#include "e-util/e-util.h"
#include "e-util/e-alert.h"
#include "shell/e-shell-view.h"
@@ -201,7 +202,7 @@ static void
emla_list_action (EMailReader *reader,
EmlaAction action)
{
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolder *folder;
GPtrArray *uids;
emla_action_data *data;
@@ -209,9 +210,9 @@ emla_list_action (EMailReader *reader,
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
- folder_uri = message_list->folder_uri;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ folder_uri = MESSAGE_LIST (message_list)->folder_uri;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
g_return_if_fail (uids->len == 1);
data = g_malloc (sizeof (emla_action_data));
diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c
index b96c01b868..5c9f795c20 100644
--- a/plugins/templates/templates.c
+++ b/plugins/templates/templates.c
@@ -698,7 +698,7 @@ update_actions_cb (EShellView *shell_view)
EShellWindow *shell_window;
GtkActionGroup *action_group;
GtkUIManager *ui_manager;
- MessageList *message_list;
+ GtkWidget *message_list;
CamelFolderInfo *folder_info;
CamelFolder *folder;
CamelStore *store;
@@ -726,8 +726,8 @@ update_actions_cb (EShellView *shell_view)
reader = E_MAIL_READER (shell_content);
message_list = e_mail_reader_get_message_list (reader);
- folder = message_list->folder;
- uids = message_list_get_selected (message_list);
+ folder = MESSAGE_LIST (message_list)->folder;
+ uids = message_list_get_selected (MESSAGE_LIST (message_list));
if (uids->len != 1)
goto exit;
@@ -745,7 +745,8 @@ update_actions_cb (EShellView *shell_view)
build_template_menus_recurse (
ui_manager, action_group,
"/mail-message-popup/mail-message-templates",
- &action_count, merge_id, folder_info, message_list->folder, uids->pdata[0]);
+ &action_count, merge_id, folder_info,
+ MESSAGE_LIST (message_list)->folder, uids->pdata[0]);
exit:
em_utils_uids_free (uids);