diff options
author | Xan Lopez <xan@src.gnome.org> | 2009-03-02 03:47:02 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2009-03-02 03:47:02 +0800 |
commit | 47ad1005ec007fc15b2ed83d78101a9785688afe (patch) | |
tree | b0805d4c7976a32d384c56b3144ff4569172e503 /src | |
parent | 2594a1ecfee6163933953bfe9520fef351f13da1 (diff) | |
download | gsoc2013-epiphany-47ad1005ec007fc15b2ed83d78101a9785688afe.tar gsoc2013-epiphany-47ad1005ec007fc15b2ed83d78101a9785688afe.tar.gz gsoc2013-epiphany-47ad1005ec007fc15b2ed83d78101a9785688afe.tar.bz2 gsoc2013-epiphany-47ad1005ec007fc15b2ed83d78101a9785688afe.tar.lz gsoc2013-epiphany-47ad1005ec007fc15b2ed83d78101a9785688afe.tar.xz gsoc2013-epiphany-47ad1005ec007fc15b2ed83d78101a9785688afe.tar.zst gsoc2013-epiphany-47ad1005ec007fc15b2ed83d78101a9785688afe.zip |
Use new get_encoding API to properly figure out automatic vs override encoding.
svn path=/trunk/; revision=8832
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-encoding-dialog.c | 9 | ||||
-rw-r--r-- | src/ephy-encoding-menu.c | 13 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c index fcbd1ad4d..0556a8813 100644 --- a/src/ephy-encoding-dialog.c +++ b/src/ephy-encoding-dialog.c @@ -86,7 +86,7 @@ sync_encoding_against_embed (EphyEncodingDialog *dialog) GList *rows; GtkWidget *button; const char *encoding; - gboolean is_automatic; + gboolean is_automatic = FALSE; WebKitWebView *view; dialog->priv->update_tag = TRUE; @@ -96,7 +96,12 @@ sync_encoding_against_embed (EphyEncodingDialog *dialog) view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed); encoding = webkit_web_view_get_custom_encoding (view); - if (encoding == NULL) return; + if (encoding == NULL) + { + encoding = webkit_web_view_get_encoding (view); + if (encoding == NULL) return; + is_automatic = TRUE; + } node = ephy_encodings_get_node (dialog->priv->encodings, encoding, TRUE); g_assert (EPHY_IS_NODE (node)); diff --git a/src/ephy-encoding-menu.c b/src/ephy-encoding-menu.c index 4c0f955e1..7811842d2 100644 --- a/src/ephy-encoding-menu.c +++ b/src/ephy-encoding-menu.c @@ -118,7 +118,7 @@ update_encoding_menu_cb (GtkAction *dummy, EphyEncodingMenu *menu) EphyNode *enc_node; GList *recent, *related = NULL, *l; EphyLanguageGroup groups; - gboolean is_automatic; + gboolean is_automatic = FALSE; WebKitWebView *view; START_PROFILER ("Rebuilding encoding menu") @@ -132,18 +132,19 @@ update_encoding_menu_cb (GtkAction *dummy, EphyEncodingMenu *menu) /* get most recently used encodings */ recent = ephy_encodings_get_recent (p->encodings); - /* FIXME: need a plain get_encoding API in WebKit to complete this */ embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (p->window)); view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (embed); encoding = webkit_web_view_get_custom_encoding (view); - if (encoding == NULL) goto build_menu; + if (encoding == NULL) + { + encoding = webkit_web_view_get_encoding (view); + if (encoding == NULL) goto build_menu; + is_automatic = TRUE; + } enc_node = ephy_encodings_get_node (p->encodings, encoding, TRUE); g_assert (EPHY_IS_NODE (enc_node)); - /* check if encoding was overridden */ - is_automatic = ephy_embed_has_automatic_encoding (embed); - action = gtk_action_group_get_action (p->action_group, "ViewEncodingAutomatic"); gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), is_automatic); |