diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-12-02 00:43:13 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-12-02 04:01:14 +0800 |
commit | 5e938b590f66a44ed69e0867efe5158b634a7f57 (patch) | |
tree | ac3881b20ef9bcff5e93cf478e8d8abf9875dc0a /plugins/groupwise-features | |
parent | 76fbb9d23242cba427d71ded5590a9cad271b2b3 (diff) | |
download | gsoc2013-evolution-5e938b590f66a44ed69e0867efe5158b634a7f57.tar.gz gsoc2013-evolution-5e938b590f66a44ed69e0867efe5158b634a7f57.tar.zst gsoc2013-evolution-5e938b590f66a44ed69e0867efe5158b634a7f57.zip |
Expand the EMailReader interface so it's easier to use.
Adds the following methods:
CamelFolder * (*get_folder) (EMailReader *reader);
const gchar * (*get_folder_uri) (EMailReader *reader);
GPtrArray * (*get_selected_uids) (EMailReader *reader);
Diffstat (limited to 'plugins/groupwise-features')
-rw-r--r-- | plugins/groupwise-features/gw-ui.c | 14 | ||||
-rw-r--r-- | plugins/groupwise-features/junk-mail-settings.c | 11 | ||||
-rw-r--r-- | plugins/groupwise-features/mail-retract.c | 17 | ||||
-rw-r--r-- | plugins/groupwise-features/status-track.c | 17 |
4 files changed, 25 insertions, 34 deletions
diff --git a/plugins/groupwise-features/gw-ui.c b/plugins/groupwise-features/gw-ui.c index 4a33a692cd..c1146ff4d1 100644 --- a/plugins/groupwise-features/gw-ui.c +++ b/plugins/groupwise-features/gw-ui.c @@ -204,19 +204,17 @@ update_mmp_entries_cb (EShellView *shell_view, gpointer user_data) if (visible) { EShellContent *shell_content; EMailReader *reader; - GtkWidget *message_list; - GPtrArray *selected; + GPtrArray *uids; 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 (message_list)); + reader = E_MAIL_READER (shell_content); + uids = e_mail_reader_get_selected_uids (reader); - if (selected) - n_selected = selected->len; + if (uids) + n_selected = uids->len; - em_utils_uids_free (selected); + em_utils_uids_free (uids); visible = n_selected > 0; } diff --git a/plugins/groupwise-features/junk-mail-settings.c b/plugins/groupwise-features/junk-mail-settings.c index 4fc4b735c0..61a5cb0ac9 100644 --- a/plugins/groupwise-features/junk-mail-settings.c +++ b/plugins/groupwise-features/junk-mail-settings.c @@ -68,16 +68,15 @@ gw_junk_mail_settings_cb (GtkAction *action, EShellView *shell_view) gchar *msg; EShellContent *shell_content; EMailReader *reader; - GtkWidget *message_list; + CamelFolder *folder; 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 (message_list)->folder != NULL); + reader = E_MAIL_READER (shell_content); + folder = e_mail_reader_get_folder (reader); + g_return_if_fail (folder != NULL); - cnc = get_cnc (MESSAGE_LIST (message_list)->folder->parent_store); + cnc = get_cnc (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 adb97e250e..0ef1fd8e88 100644 --- a/plugins/groupwise-features/mail-retract.c +++ b/plugins/groupwise-features/mail-retract.c @@ -43,22 +43,19 @@ get_selected_info (EShellView *shell_view, CamelFolder **folder, gchar **selecte { EShellContent *shell_content; EMailReader *reader; - GtkWidget *message_list; - GPtrArray *selected; + GPtrArray *uids; 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_val_if_fail (message_list != NULL, FALSE); + reader = E_MAIL_READER (shell_content); + uids = e_mail_reader_get_selected_uids (reader); - selected = message_list_get_selected (MESSAGE_LIST (message_list)); - if (selected && selected->len == 1) { - *folder = MESSAGE_LIST (message_list)->folder; - *selected_uid = g_strdup (g_ptr_array_index (selected, 0)); + if (uids && uids->len == 1) { + *folder = e_mail_reader_get_folder (reader); + *selected_uid = g_strdup (g_ptr_array_index (uids, 0)); } - em_utils_uids_free (selected); + em_utils_uids_free (uids); return *selected_uid != NULL; } diff --git a/plugins/groupwise-features/status-track.c b/plugins/groupwise-features/status-track.c index 018e69261a..622fc3b6cd 100644 --- a/plugins/groupwise-features/status-track.c +++ b/plugins/groupwise-features/status-track.c @@ -65,24 +65,21 @@ get_selected_message (EShellView *shell_view, CamelFolder **folder, gchar **sele CamelMimeMessage *msg = NULL; EShellContent *shell_content; EMailReader *reader; - GtkWidget *message_list; - GPtrArray *selected; + GPtrArray *uids; 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_val_if_fail (message_list != NULL, NULL); + reader = E_MAIL_READER (shell_content); + uids = e_mail_reader_get_selected_uids (reader); - selected = message_list_get_selected (MESSAGE_LIST (message_list)); - if (selected && selected->len == 1) { - *folder = MESSAGE_LIST (message_list)->folder; - *selected_uid = g_strdup (g_ptr_array_index (selected, 0)); + if (uids && uids->len == 1) { + *folder = e_mail_reader_get_folder (reader); + *selected_uid = g_strdup (g_ptr_array_index (uids, 0)); msg = camel_folder_get_message (*folder, *selected_uid, NULL); } - em_utils_uids_free (selected); + em_utils_uids_free (uids); return msg; } |