[evolution/wip/webkit-composer: 227/372] EMsgComposer: Use e_editor_new_activity().



commit c6bf9c9557dcfd8de6c5940c1377955ca03902b6
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 7f9b727..30875b5 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -3480,9 +3480,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;
 
@@ -3496,18 +3495,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,
@@ -3591,25 +3584,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,
@@ -3674,9 +3660,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;
 
@@ -3688,18 +3673,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,
@@ -3761,26 +3740,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]