[evolution/webkit-composer: 161/231] EMsgComposer: Use e_editor_new_activity().



commit 77429c0aeab8ce2ebfc2fd3d43ee21c0e222515d
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Feb 8 07:46:09 2013 -0500

    EMsgComposer: Use e_editor_new_activity().
    
    Instead of e_composer_activity_new().

 composer/e-msg-composer.c |   68 +++++++++++++-------------------------------
 1 files changed, 20 insertions(+), 48 deletions(-)
---
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 504d483..7ddbd87 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -3454,9 +3454,8 @@ msg_composer_send_cb (EMsgComposer *composer,
 void
 e_msg_composer_send (EMsgComposer *composer)
 {
+       EEditor *editor;
        AsyncContext *context;
-       EAlertSink *alert_sink;
-       EActivityBar *activity_bar;
        GCancellable *cancellable;
        gboolean proceed_with_send = TRUE;
 
@@ -3470,18 +3469,12 @@ e_msg_composer_send (EMsgComposer *composer)
                return;
        }
 
-       context = g_slice_new0 (AsyncContext);
-       context->activity = e_composer_activity_new (composer);
-
-       alert_sink = E_ALERT_SINK (composer);
-       e_activity_set_alert_sink (context->activity, alert_sink);
+       editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
 
-       cancellable = camel_operation_new ();
-       e_activity_set_cancellable (context->activity, cancellable);
-       g_object_unref (cancellable);
+       context = g_slice_new0 (AsyncContext);
+       context->activity = e_editor_new_activity (editor);
 
-       activity_bar = E_ACTIVITY_BAR (composer->priv->activity_bar);
-       e_activity_bar_set_activity (activity_bar, context->activity);
+       cancellable = e_activity_get_cancellable (context->activity);
 
        e_msg_composer_get_message (
                composer, G_PRIORITY_DEFAULT, cancellable,
@@ -3565,25 +3558,18 @@ msg_composer_save_to_drafts_cb (EMsgComposer *composer,
 void
 e_msg_composer_save_to_drafts (EMsgComposer *composer)
 {
+       EEditor *editor;
        AsyncContext *context;
-       EAlertSink *alert_sink;
-       EActivityBar *activity_bar;
        GCancellable *cancellable;
 
        g_return_if_fail (E_IS_MSG_COMPOSER (composer));
 
-       context = g_slice_new0 (AsyncContext);
-       context->activity = e_composer_activity_new (composer);
-
-       alert_sink = E_ALERT_SINK (composer);
-       e_activity_set_alert_sink (context->activity, alert_sink);
+       editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
 
-       cancellable = camel_operation_new ();
-       e_activity_set_cancellable (context->activity, cancellable);
-       g_object_unref (cancellable);
+       context = g_slice_new0 (AsyncContext);
+       context->activity = e_editor_new_activity (editor);
 
-       activity_bar = E_ACTIVITY_BAR (composer->priv->activity_bar);
-       e_activity_bar_set_activity (activity_bar, context->activity);
+       cancellable = e_activity_get_cancellable (context->activity);
 
        e_msg_composer_get_message_draft (
                composer, G_PRIORITY_DEFAULT, cancellable,
@@ -3648,9 +3634,8 @@ msg_composer_save_to_outbox_cb (EMsgComposer *composer,
 void
 e_msg_composer_save_to_outbox (EMsgComposer *composer)
 {
+       EEditor *editor;
        AsyncContext *context;
-       EAlertSink *alert_sink;
-       EActivityBar *activity_bar;
        GCancellable *cancellable;
        gboolean proceed_with_save = TRUE;
 
@@ -3662,18 +3647,12 @@ e_msg_composer_save_to_outbox (EMsgComposer *composer)
        if (!proceed_with_save)
                return;
 
-       context = g_slice_new0 (AsyncContext);
-       context->activity = e_composer_activity_new (composer);
-
-       alert_sink = E_ALERT_SINK (composer);
-       e_activity_set_alert_sink (context->activity, alert_sink);
+       editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
 
-       cancellable = camel_operation_new ();
-       e_activity_set_cancellable (context->activity, cancellable);
-       g_object_unref (cancellable);
+       context = g_slice_new0 (AsyncContext);
+       context->activity = e_editor_new_activity (editor);
 
-       activity_bar = E_ACTIVITY_BAR (composer->priv->activity_bar);
-       e_activity_bar_set_activity (activity_bar, context->activity);
+       cancellable = e_activity_get_cancellable (context->activity);
 
        e_msg_composer_get_message (
                composer, G_PRIORITY_DEFAULT, cancellable,
@@ -3735,26 +3714,19 @@ void
 e_msg_composer_print (EMsgComposer *composer,
                       GtkPrintOperationAction print_action)
 {
+       EEditor *editor;
        AsyncContext *context;
-       EAlertSink *alert_sink;
-       EActivityBar *activity_bar;
        GCancellable *cancellable;
 
        g_return_if_fail (E_IS_MSG_COMPOSER (composer));
 
+       editor = e_editor_window_get_editor (E_EDITOR_WINDOW (composer));
+
        context = g_slice_new0 (AsyncContext);
-       context->activity = e_composer_activity_new (composer);
+       context->activity = e_editor_new_activity (editor);
        context->print_action = print_action;
 
-       alert_sink = E_ALERT_SINK (composer);
-       e_activity_set_alert_sink (context->activity, alert_sink);
-
-       cancellable = camel_operation_new ();
-       e_activity_set_cancellable (context->activity, cancellable);
-       g_object_unref (cancellable);
-
-       activity_bar = E_ACTIVITY_BAR (composer->priv->activity_bar);
-       e_activity_bar_set_activity (activity_bar, context->activity);
+       cancellable = e_activity_get_cancellable (context->activity);
 
        e_msg_composer_get_message_print (
                composer, G_PRIORITY_DEFAULT, cancellable,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]