[evolution] EHTMLEditorView - Clean the e_html_editor_view_init function



commit 73409c0627af5d751a3c0e7bf6ddbd9fbea5165f
Author: Tomas Popela <tpopela redhat com>
Date:   Mon Mar 16 09:18:50 2015 +0100

    EHTMLEditorView - Clean the e_html_editor_view_init function

 e-util/e-html-editor-view.c |   37 ++++++++++++++-----------------------
 1 files changed, 14 insertions(+), 23 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index eb3623d..c23d772 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -9050,6 +9050,17 @@ e_html_editor_view_init (EHTMLEditorView *view)
        view->priv = E_HTML_EDITOR_VIEW_GET_PRIVATE (view);
 
        webkit_web_view_set_editable (WEBKIT_WEB_VIEW (view), TRUE);
+
+       /* Override the spell-checker, use our own */
+       checker = e_spell_checker_new ();
+       webkit_set_text_checker (G_OBJECT (checker));
+       g_object_unref (checker);
+
+       /* Give spell check languages to WebKit */
+       languages = e_spell_checker_list_active_languages (checker, NULL);
+       comma_separated = g_strjoinv (",", languages);
+       g_strfreev (languages);
+
        settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW (view));
 
        g_object_set (
@@ -9061,17 +9072,15 @@ e_html_editor_view_init (EHTMLEditorView *view)
                "enable-scripts", FALSE,
                "enable-spell-checking", TRUE,
                "respect-image-orientation", TRUE,
+               "spell-checking-languages", comma_separated,
                NULL);
 
+       g_free (comma_separated);
+
        webkit_web_view_set_settings (WEBKIT_WEB_VIEW (view), settings);
 
        view->priv->old_settings = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) 
g_variant_unref);
 
-       /* Override the spell-checker, use our own */
-       checker = e_spell_checker_new ();
-       webkit_set_text_checker (G_OBJECT (checker));
-       g_object_unref (checker);
-
        /* Don't use CSS when possible to preserve compatibility with older
         * versions of Evolution or other MUAs */
        e_html_editor_view_exec_command (
@@ -9135,18 +9144,6 @@ e_html_editor_view_init (EHTMLEditorView *view)
 
        e_html_editor_view_update_fonts (view);
 
-       /* Give spell check languages to WebKit */
-       languages = e_spell_checker_list_active_languages (checker, NULL);
-       comma_separated = g_strjoinv (",", languages);
-       g_strfreev (languages);
-
-       g_object_set (
-               G_OBJECT (settings),
-               "spell-checking-languages", comma_separated,
-               NULL);
-
-       g_free (comma_separated);
-
        view->priv->body_input_event_removed = TRUE;
        view->priv->is_message_from_draft = FALSE;
        view->priv->is_message_from_selection = FALSE;
@@ -9159,12 +9156,6 @@ e_html_editor_view_init (EHTMLEditorView *view)
        view->priv->undo_redo_in_progress = FALSE;
        view->priv->dont_save_history_in_body_input = FALSE;
 
-       g_object_set (
-               G_OBJECT (settings),
-               "enable-scripts", FALSE,
-               "enable-plugins", FALSE,
-               NULL);
-
        /* Make WebKit think we are displaying a local file, so that it
         * does not block loading resources from file:// protocol */
        webkit_web_view_load_string (


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