From aba053264da43f60b0628077e79cd52e3d78394a Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Thu, 18 Dec 2003 15:58:01 +0000 Subject: Factor out the common encoding is_automatic check. 2003-12-18 Christian Persch * embed/ephy-encodings.c: (ephy_encoding_info_is_automatic): * embed/ephy-encodings.h: * src/ephy-encoding-dialog.c: (sync_embed_cb): * src/ephy-encoding-menu.c: (update_encoding_menu_cb): Factor out the common encoding is_automatic check. --- embed/ephy-encodings.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'embed/ephy-encodings.c') diff --git a/embed/ephy-encodings.c b/embed/ephy-encodings.c index c50ba19c2..c66adde85 100644 --- a/embed/ephy-encodings.c +++ b/embed/ephy-encodings.c @@ -457,6 +457,15 @@ ephy_encoding_info_free (EphyEncodingInfo *info) } } +gboolean +ephy_encoding_info_is_automatic (EphyEncodingInfo *info) +{ + g_return_val_if_fail (info != NULL, FALSE); + + return (info->encoding_source < EMBED_ENCODING_PARENT_FORCED) + && (info->forced_encoding == NULL || info->forced_encoding[0] == '\0'); +} + EphyEncodings * ephy_encodings_new (void) { -- cgit