aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-07-09 03:06:05 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-07-09 20:44:22 +0800
commit5bd9b582903a1bd949ade4b0a46e8a8b9b116561 (patch)
tree89e1984ef3577e22cc2c2f2b1ad9224d3d085322
parenta7bab4dcafe4ecb2e838c330f9b1777e641c7d14 (diff)
downloadgsoc2013-evolution-5bd9b582903a1bd949ade4b0a46e8a8b9b116561.tar.gz
gsoc2013-evolution-5bd9b582903a1bd949ade4b0a46e8a8b9b116561.tar.zst
gsoc2013-evolution-5bd9b582903a1bd949ade4b0a46e8a8b9b116561.zip
Remove mail_refresh_folder().
Use e_mail_reader_refresh_folder() instead.
-rw-r--r--libemail-engine/mail-ops.c44
-rw-r--r--libemail-engine/mail-ops.h4
-rw-r--r--mail/e-mail-paned-view.c2
-rw-r--r--modules/mail/e-mail-shell-view-actions.c22
4 files changed, 19 insertions, 53 deletions
diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c
index 27476d90ae..5543151aef 100644
--- a/libemail-engine/mail-ops.c
+++ b/libemail-engine/mail-ops.c
@@ -1325,50 +1325,6 @@ mail_sync_store (CamelStore *store,
/* ******************************************************************************** */
-static gchar *
-refresh_folder_desc (struct _sync_folder_msg *m)
-{
- return g_strdup_printf (
- _("Refreshing folder '%s'"),
- camel_folder_get_full_name (m->folder));
-}
-
-static void
-refresh_folder_exec (struct _sync_folder_msg *m,
- GCancellable *cancellable,
- GError **error)
-{
- camel_folder_refresh_info_sync (
- m->folder, cancellable, error);
-}
-
-/* we just use the sync stuff where we can, since it would be the same */
-static MailMsgInfo refresh_folder_info = {
- sizeof (struct _sync_folder_msg),
- (MailMsgDescFunc) refresh_folder_desc,
- (MailMsgExecFunc) refresh_folder_exec,
- (MailMsgDoneFunc) sync_folder_done,
- (MailMsgFreeFunc) sync_folder_free
-};
-
-void
-mail_refresh_folder (CamelFolder *folder,
- void (*done) (CamelFolder *folder,
- gpointer data),
- gpointer data)
-{
- struct _sync_folder_msg *m;
-
- m = mail_msg_new (&refresh_folder_info);
- m->folder = g_object_ref (folder);
- m->data = data;
- m->done = done;
-
- mail_msg_slow_ordered_push (m);
-}
-
-/* ******************************************************************************** */
-
static gboolean
folder_is_from_source_uid (CamelFolder *folder,
const gchar *source_uid)
diff --git a/libemail-engine/mail-ops.h b/libemail-engine/mail-ops.h
index 7ec9b14f4f..84b4699286 100644
--- a/libemail-engine/mail-ops.h
+++ b/libemail-engine/mail-ops.h
@@ -45,10 +45,6 @@ void mail_sync_folder (CamelFolder *folder,
void mail_sync_store (CamelStore *store, gint expunge,
void (*done) (CamelStore *store, gpointer data), gpointer data);
-void mail_refresh_folder (CamelFolder *folder,
- void (*done) (CamelFolder *folder, gpointer data),
- gpointer data);
-
void mail_expunge_folder (CamelFolder *folder);
void mail_empty_trash (CamelStore *store);
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index 24db42dda9..55fbd93589 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -535,7 +535,7 @@ mail_paned_view_set_folder (EMailReader *reader,
/* Only refresh the folder if we're online. */
if (e_shell_get_online (shell))
- mail_refresh_folder (folder, NULL, NULL);
+ e_mail_reader_refresh_folder (reader, folder);
/* This is a one-time-only callback. */
if (MESSAGE_LIST (message_list)->cursor_uid == NULL &&
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index 04d23ef509..3d39c4f3dc 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -522,16 +522,30 @@ static void
action_mail_folder_refresh_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
+ EMailShellContent *mail_shell_content;
EMailShellSidebar *mail_shell_sidebar;
+ EMailView *mail_view;
EMFolderTree *folder_tree;
- CamelFolder *folder;
+ CamelStore *selected_store = NULL;
+ gchar *selected_folder_name = NULL;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ mail_view = e_mail_shell_content_get_mail_view (mail_shell_content);
mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar;
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
- folder = em_folder_tree_get_selected_folder (folder_tree);
- g_return_if_fail (folder != NULL);
- mail_refresh_folder (folder, NULL, NULL);
+ em_folder_tree_get_selected (
+ folder_tree, &selected_store, &selected_folder_name);
+ g_return_if_fail (CAMEL_IS_STORE (selected_store));
+ g_return_if_fail (selected_folder_name != NULL);
+
+ e_mail_reader_refresh_folder_name (
+ E_MAIL_READER (mail_view),
+ selected_store, selected_folder_name);
+
+ g_object_unref (selected_store);
+ g_free (selected_folder_name);
}
static void