aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-07-09 00:43:41 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-07-09 20:44:22 +0800
commit9c797884816c948ead7eb93070d639498f321bd4 (patch)
tree5ebd624db23c72dbff62149f2ac1f7495adfec20 /modules
parent451afa8429b6ff074d8d0aa93d18e1f5043627ea (diff)
downloadgsoc2013-evolution-9c797884816c948ead7eb93070d639498f321bd4.tar.gz
gsoc2013-evolution-9c797884816c948ead7eb93070d639498f321bd4.tar.zst
gsoc2013-evolution-9c797884816c948ead7eb93070d639498f321bd4.zip
Add e_mail_reader_unsubscribe_folder_name().
Replaces e_mail_session_unsubscribe_folder().
Diffstat (limited to 'modules')
-rw-r--r--modules/mail/e-mail-shell-view-actions.c79
1 files changed, 16 insertions, 63 deletions
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index 9306704ed7..04d23ef509 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -26,35 +26,6 @@
#include "e-mail-shell-view-private.h"
static void
-mail_folder_unsubscribe_done_cb (EMailSession *session,
- GAsyncResult *result,
- EActivity *activity)
-{
- EAlertSink *alert_sink;
- GError *error = NULL;
-
- alert_sink = e_activity_get_alert_sink (activity);
-
- e_mail_session_unsubscribe_folder_finish (session, result, &error);
-
- if (e_activity_handle_cancellation (activity, error)) {
- g_error_free (error);
-
- } else if (error != NULL) {
- e_alert_submit (
- alert_sink,
- "mail:folder-unsubscribe",
- error->message, NULL);
- g_error_free (error);
-
- } else {
- e_activity_set_state (activity, E_ACTIVITY_COMPLETED);
- }
-
- g_object_unref (activity);
-}
-
-static void
action_gal_save_custom_view_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
@@ -616,48 +587,30 @@ static void
action_mail_folder_unsubscribe_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
+ EMailShellContent *mail_shell_content;
EMailShellSidebar *mail_shell_sidebar;
- EShellBackend *shell_backend;
- EShellContent *shell_content;
- EShellView *shell_view;
- EMailBackend *backend;
- EMailSession *session;
+ EMailView *mail_view;
EMFolderTree *folder_tree;
- EActivity *activity;
- EAlertSink *alert_sink;
- GCancellable *cancellable;
- gchar *folder_uri;
+ 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);
- shell_view = E_SHELL_VIEW (mail_shell_view);
- shell_backend = e_shell_view_get_shell_backend (shell_view);
- shell_content = e_shell_view_get_shell_content (shell_view);
-
- backend = E_MAIL_BACKEND (shell_backend);
- session = e_mail_backend_get_session (backend);
-
- activity = e_activity_new ();
-
- alert_sink = E_ALERT_SINK (shell_content);
- e_activity_set_alert_sink (activity, alert_sink);
-
- cancellable = camel_operation_new ();
- e_activity_set_cancellable (activity, cancellable);
-
- e_shell_backend_add_activity (shell_backend, activity);
-
- folder_uri = em_folder_tree_get_selected_uri (folder_tree);
-
- e_mail_session_unsubscribe_folder (
- session, folder_uri, G_PRIORITY_DEFAULT, cancellable,
- (GAsyncReadyCallback) mail_folder_unsubscribe_done_cb,
- activity);
+ 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);
- g_free (folder_uri);
+ e_mail_reader_unsubscribe_folder_name (
+ E_MAIL_READER (mail_view),
+ selected_store, selected_folder_name);
- g_object_unref (cancellable);
+ g_object_unref (selected_store);
+ g_free (selected_folder_name);
}
static void