diff options
author | Xan Lopez <xan@igalia.com> | 2013-03-16 21:23:44 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2013-03-16 21:23:54 +0800 |
commit | 962c16cddee4b246c434ffed44913f192ad1ba79 (patch) | |
tree | 520aca0f9ba593371cec163dd546a735dbde95c4 | |
parent | 0a5d0060f7fb508da30040b09d1035aa3f40b2e3 (diff) | |
download | gsoc2013-epiphany-962c16cddee4b246c434ffed44913f192ad1ba79.tar gsoc2013-epiphany-962c16cddee4b246c434ffed44913f192ad1ba79.tar.gz gsoc2013-epiphany-962c16cddee4b246c434ffed44913f192ad1ba79.tar.bz2 gsoc2013-epiphany-962c16cddee4b246c434ffed44913f192ad1ba79.tar.lz gsoc2013-epiphany-962c16cddee4b246c434ffed44913f192ad1ba79.tar.xz gsoc2013-epiphany-962c16cddee4b246c434ffed44913f192ad1ba79.tar.zst gsoc2013-epiphany-962c16cddee4b246c434ffed44913f192ad1ba79.zip |
Revert "Add spelling suggestion to the context menu in WebKit2"
This reverts commit 45e86f4c6f6922fb0b554c738967b9403bd70ecc.
Pushed this by mistake.
-rw-r--r-- | src/ephy-window.c | 51 |
1 files changed, 4 insertions, 47 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c index 223ff953b..26b902797 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -1844,34 +1844,6 @@ find_item_in_context_menu (WebKitContextMenu *context_menu, return NULL; } -static GList * -find_spelling_guess_context_menu_items (WebKitContextMenu *context_menu) -{ - GList *items, *iter; - GList *retval = NULL; - - items = webkit_context_menu_get_items (context_menu); - for (iter = items; iter; iter = g_list_next (iter)) - { - WebKitContextMenuItem *item = (WebKitContextMenuItem *)iter->data; - - if (webkit_context_menu_item_get_stock_action (item) == WEBKIT_CONTEXT_MENU_ACTION_SPELLING_GUESS) - { - retval = g_list_prepend (retval, g_object_ref (item)); - } - else - { - /* Spelling guesses are always at the beginning of the context menu, so - * we can break the loop as soon as we find the first item that is not - * spelling guess. - */ - break; - } - } - - return g_list_reverse (retval); -} - static gboolean populate_context_menu (WebKitWebView *web_view, WebKitContextMenu *context_menu, @@ -1880,18 +1852,14 @@ populate_context_menu (WebKitWebView *web_view, EphyWindow *window) { EphyWindowPrivate *priv = window->priv; - WebKitContextMenuItem *input_methods_item = NULL; - WebKitContextMenuItem *unicode_item = NULL; - GList *spelling_guess_items = NULL; + WebKitContextMenuItem *input_methods_item; + WebKitContextMenuItem *unicode_item; EphyEmbedEvent *embed_event; gboolean is_document = FALSE; gboolean app_mode; - if (webkit_hit_test_result_context_is_editable (hit_test_result)) { - input_methods_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_INPUT_METHODS); - unicode_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_UNICODE); - spelling_guess_items = find_spelling_guess_context_menu_items (context_menu); - } + input_methods_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_INPUT_METHODS); + unicode_item = find_item_in_context_menu (context_menu, WEBKIT_CONTEXT_MENU_ACTION_UNICODE); webkit_context_menu_remove_all (context_menu); @@ -1952,17 +1920,6 @@ populate_context_menu (WebKitWebView *web_view, } else if (webkit_hit_test_result_context_is_editable (hit_test_result)) { - GList *l; - - for (l = spelling_guess_items; l; l = g_list_next (l)) - { - WebKitContextMenuItem *item = WEBKIT_CONTEXT_MENU_ITEM (l->data); - - webkit_context_menu_append (context_menu, item); - g_object_unref (item); - } - g_list_free (spelling_guess_items); - update_edit_actions_sensitivity (window, FALSE); add_action_to_context_menu (context_menu, |