aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-18 00:08:07 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-05-18 07:51:11 +0800
commitb3b917365ff2e813df0503e94267f2cb3bab4255 (patch)
tree30fc79ded6cfd43eed38d09c20ed8884c1a9a739 /modules
parent8520334bc8a1745f5954f0b69252418e12d4c3a2 (diff)
downloadgsoc2013-evolution-b3b917365ff2e813df0503e94267f2cb3bab4255.tar
gsoc2013-evolution-b3b917365ff2e813df0503e94267f2cb3bab4255.tar.gz
gsoc2013-evolution-b3b917365ff2e813df0503e94267f2cb3bab4255.tar.bz2
gsoc2013-evolution-b3b917365ff2e813df0503e94267f2cb3bab4255.tar.lz
gsoc2013-evolution-b3b917365ff2e813df0503e94267f2cb3bab4255.tar.xz
gsoc2013-evolution-b3b917365ff2e813df0503e94267f2cb3bab4255.tar.zst
gsoc2013-evolution-b3b917365ff2e813df0503e94267f2cb3bab4255.zip
Remove mail_store_prepare_offline().
Use e_mail_store_prepare_for_offline() instead.
Diffstat (limited to 'modules')
-rw-r--r--modules/mail/e-mail-shell-view-actions.c53
-rw-r--r--modules/mail/e-mail-shell-view-private.h1
2 files changed, 50 insertions, 4 deletions
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index a0a6ec2dfe..dcef6afe74 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -170,17 +170,62 @@ action_mail_create_search_folder_cb (GtkAction *action,
}
static void
-action_mail_download_foreach_cb (CamelService *service)
+action_mail_download_finished_cb (CamelStore *store,
+ GAsyncResult *result,
+ EActivity *activity)
{
- if (CAMEL_IS_DISCO_STORE (service) || CAMEL_IS_OFFLINE_STORE (service))
- mail_store_prepare_offline (CAMEL_STORE (service));
+ EAlertSink *alert_sink;
+ GError *error = NULL;
+
+ alert_sink = e_activity_get_alert_sink (activity);
+
+ e_mail_store_prepare_for_offline_finish (store, result, &error);
+
+ if (e_activity_handle_cancellation (activity, error)) {
+ g_error_free (error);
+
+ } else if (error != NULL) {
+ e_alert_submit (
+ alert_sink, "mail:prepare-for-offline",
+ error->message, NULL);
+ g_error_free (error);
+ }
+
+ g_object_unref (activity);
+}
+
+static void
+action_mail_download_foreach_cb (CamelStore *store,
+ const gchar *display_name,
+ EMailReader *reader)
+{
+ EActivity *activity;
+ GCancellable *cancellable;
+
+ activity = e_mail_reader_new_activity (reader);
+ cancellable = e_activity_get_cancellable (activity);
+
+ e_mail_store_prepare_for_offline (
+ store, G_PRIORITY_DEFAULT,
+ cancellable, (GAsyncReadyCallback)
+ action_mail_download_finished_cb, activity);
}
static void
action_mail_download_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
- e_mail_store_foreach ((GHFunc) action_mail_download_foreach_cb, NULL);
+ EMailShellContent *mail_shell_content;
+ EMailView *mail_view;
+ EMailReader *reader;
+
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ mail_view = e_mail_shell_content_get_mail_view (mail_shell_content);
+
+ reader = E_MAIL_READER (mail_view);
+
+ e_mail_store_foreach (
+ (GHFunc) action_mail_download_foreach_cb, reader);
}
static void
diff --git a/modules/mail/e-mail-shell-view-private.h b/modules/mail/e-mail-shell-view-private.h
index b8c25719a5..15bcf8ccf3 100644
--- a/modules/mail/e-mail-shell-view-private.h
+++ b/modules/mail/e-mail-shell-view-private.h
@@ -47,6 +47,7 @@
#include "e-mail-session-utils.h"
#include "e-mail-sidebar.h"
#include "e-mail-store.h"
+#include "e-mail-store-utils.h"
#include "em-composer-utils.h"
#include "em-folder-properties.h"
#include "em-folder-selector.h"