[evolution] Composer - Set GObject's data on history event instead on its data and rename them



commit da7386ffa7639112e5a11f8faec89f55ec3bf72b
Author: Tomas Popela <tpopela redhat com>
Date:   Thu Dec 3 15:46:24 2015 +0100

    Composer - Set GObject's data on history event instead on its data and rename them
    
    No change in functionality.

 composer/e-msg-composer.c   |   15 +++++++--------
 e-util/e-html-editor-view.c |   32 ++++++++++++++++++--------------
 2 files changed, 25 insertions(+), 22 deletions(-)
---
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 728310b..cd3d671 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1848,8 +1848,7 @@ insert_nbsp_history_event (EHTMLEditorView *editor_view,
        event->type = HISTORY_DELETE;
 
        if (delete)
-               g_object_set_data (
-                       G_OBJECT (fragment), "-x-evo-delete-key", GINT_TO_POINTER (1));
+               g_object_set_data (G_OBJECT (event), "history-delete-key", GINT_TO_POINTER (1));
 
        event->data.fragment = fragment;
 
@@ -1978,7 +1977,7 @@ msg_composer_drag_drop_cb (GtkWidget *widget,
                                /* Select the whole line (to the beginning of the next
                                 * one so we can reuse the undo code while undoing this.
                                 * Because of this we need to special mark the event
-                                * with -x-evo-drag-and-drop to correct the selection
+                                * with history-drag-and-drop to correct the selection
                                 * after undoing it (otherwise the beginning of the next
                                 * line will be selected as well. */
                                webkit_dom_dom_selection_modify (
@@ -2011,13 +2010,13 @@ msg_composer_drag_drop_cb (GtkWidget *widget,
                                                webkit_dom_node_clone_node (tmp_block, FALSE),
                                                NULL);
                                        g_object_set_data (
-                                               G_OBJECT (fragment),
-                                               "-x-evo-drag-and-drop",
+                                               G_OBJECT (event),
+                                               "history-drag-and-drop",
                                                GINT_TO_POINTER (1));
                                        /* It should act as a Delete key press. */
-                                       g_object_set_data (G_OBJECT (
-                                               fragment),
-                                               "-x-evo-delete-key",
+                                       g_object_set_data (
+                                               G_OBJECT (event),
+                                               "history-delete-key",
                                                GINT_TO_POINTER (1));
                                }
                        }
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index dea23e4..f6bf7d8 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -2668,7 +2668,7 @@ save_history_for_input (EHTMLEditorView *view)
                        offset - 1,
                        NULL);
        fragment = webkit_dom_range_clone_contents (range_clone, NULL);
-       /* We have to specialy handle Return key press */
+       /* We have to specially handle Return key press */
        if (view->priv->return_key_pressed) {
                WebKitDOMElement *element_start, *element_end;
                WebKitDOMNode *parent_start, *parent_end, *node;
@@ -2730,7 +2730,7 @@ save_history_for_input (EHTMLEditorView *view)
                remove_node (WEBKIT_DOM_NODE (element_end));
 
                g_object_set_data (
-                       G_OBJECT (fragment), "-x-evo-return-key", GINT_TO_POINTER (1));
+                       G_OBJECT (ev), "history-return-key", GINT_TO_POINTER (1));
 
                webkit_dom_dom_selection_modify (dom_selection, "move", "right", "character");
        } else {
@@ -4443,8 +4443,8 @@ save_history_for_delete_or_backspace (EHTMLEditorView *view,
                                                                        NULL);
                                                        }
                                                        g_object_set_data (
-                                                               G_OBJECT (fragment),
-                                                               "-x-evo-fragment",
+                                                               G_OBJECT (ev),
+                                                               "history-concatenating-blocks",
                                                                GINT_TO_POINTER (1));
                                                }
                                        }
@@ -4471,7 +4471,10 @@ save_history_for_delete_or_backspace (EHTMLEditorView *view,
                if (!fragment)
                        fragment = webkit_dom_range_clone_contents (range_clone, NULL);
                if (removing_from_anchor)
-                       g_object_set_data (G_OBJECT (fragment), "-x-evo-removing-from-anchor", 
GINT_TO_POINTER (1));
+                       g_object_set_data (
+                               G_OBJECT (ev),
+                               "history-removing-from-anchor",
+                               GINT_TO_POINTER (1));
                node = webkit_dom_node_get_first_child (WEBKIT_DOM_NODE (fragment));
                if (!node) {
                        g_free (ev);
@@ -4713,8 +4716,8 @@ save_history_for_delete_or_backspace (EHTMLEditorView *view,
        g_object_unref (range);
        g_object_unref (dom_selection);
 
-       g_object_set_data (G_OBJECT (fragment), "-x-evo-delete-key", GINT_TO_POINTER (delete_key));
-       g_object_set_data (G_OBJECT (fragment), "-x-evo-control-key", GINT_TO_POINTER (control_key));
+       g_object_set_data (G_OBJECT (ev), "history-delete-key", GINT_TO_POINTER (delete_key));
+       g_object_set_data (G_OBJECT (ev), "history-control-key", GINT_TO_POINTER (control_key));
 
        ev->data.fragment = fragment;
        e_html_editor_view_insert_new_history_event (view, ev);
@@ -12689,7 +12692,7 @@ undo_delete (EHTMLEditorView *view,
 
        /* Delete or BackSpace pressed in the beginning of a block or on its end. */
        if (event->type == HISTORY_DELETE && !single_block &&
-           g_object_get_data (G_OBJECT (event->data.fragment), "-x-evo-fragment")) {
+           g_object_get_data (G_OBJECT (event), "history-concatenating-blocks")) {
                WebKitDOMNode *node, *block;
 
                range = get_range_for_point (document, event->after.start);
@@ -12762,7 +12765,7 @@ undo_delete (EHTMLEditorView *view,
 
        /* Redoing Return key press */
        if (event->type == HISTORY_INPUT && (empty ||
-           g_object_get_data (G_OBJECT (event->data.fragment), "-x-evo-return-key"))) {
+           g_object_get_data (G_OBJECT (event), "history-return-key"))) {
                if (key_press_event_process_return_key (view)) {
                        body_key_up_event_process_return_key (view);
                } else {
@@ -13006,7 +13009,7 @@ undo_delete (EHTMLEditorView *view,
 
                /* If undoing drag and drop where the whole line was moved we need
                 * to correct the selection. */
-               if (g_object_get_data (G_OBJECT (event->data.fragment), "-x-evo-drag-and-drop") &&
+               if (g_object_get_data (G_OBJECT (event), "history-drag-and-drop") &&
                    (element = webkit_dom_document_get_element_by_id (document, 
"-x-evo-selection-end-marker"))) {
                        WebKitDOMNode *prev_block;
 
@@ -13082,7 +13085,7 @@ undo_delete (EHTMLEditorView *view,
                                        webkit_dom_node_get_next_sibling (parent),
                                        NULL);
                        } else {
-                               if (g_object_get_data (G_OBJECT (event->data.fragment), 
"-x-evo-removing-from-anchor") ||
+                               if (g_object_get_data (G_OBJECT (event), "history-removing-from-anchor") ||
                                    !event_selection_was_collapsed (event)) {
                                        webkit_dom_node_insert_before (
                                                webkit_dom_node_get_parent_node (WEBKIT_DOM_NODE (element)),
@@ -13169,8 +13172,8 @@ redo_delete (EHTMLEditorView *view,
 
        restore_selection_to_history_event_state (view, event->before);
 
-       delete_key = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (event->data.fragment), 
"-x-evo-delete-key"));
-       control_key = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (event->data.fragment), 
"-x-evo-control-key"));
+       delete_key = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (event), "history-delete-key"));
+       control_key = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (event), "history-control-key"));
 
        if (!delete_key && key_press_event_process_backspace_key (view))
                goto out;
@@ -13193,7 +13196,8 @@ redo_delete (EHTMLEditorView *view,
         * is wrapped on multiple lines, the last line will by separated
         * by WebKit to the separate block. To avoid it let's remove
         * all quoting and wrapping from the next paragraph. */
-       if (delete_key && GPOINTER_TO_INT (g_object_get_data (G_OBJECT (event->data.fragment), 
"-x-evo-fragment"))) {
+       if (delete_key &&
+           GPOINTER_TO_INT (g_object_get_data (G_OBJECT (event), "history-concatenating-blocks"))) {
                WebKitDOMNode *current_block, *next_block, *node;
                WebKitDOMRange *range;
 


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