aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/mozilla-notifiers.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-10-14 01:38:16 +0800
committerChristian Persch <chpe@src.gnome.org>2003-10-14 01:38:16 +0800
commit442741fc4fb9b63c78c37f305d443f8aa57ff67e (patch)
tree834a2350618ff9378d1aaea422e1db9e0e9a304b /embed/mozilla/mozilla-notifiers.cpp
parentab827f639671b79f2b802b19f86e937a92612ad7 (diff)
downloadgsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.tar
gsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.tar.gz
gsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.tar.bz2
gsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.tar.lz
gsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.tar.xz
gsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.tar.zst
gsoc2013-epiphany-442741fc4fb9b63c78c37f305d443f8aa57ff67e.zip
Encodings menu improvements, part 3: Refactored the encodings list; it no
2003-10-13 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-embed-single.c: (ephy_embed_single_free_passwords): * embed/ephy-embed-single.h: * embed/ephy-embed-utils.c: (ephy_embed_utils_build_encodings_submenu): * embed/mozilla/mozilla-embed-single.cpp: * embed/mozilla/mozilla-notifiers.cpp: * lib/Makefile.am: * lib/ephy-encodings.c: (ephy_encoding_info_free), (encodings_info_cmp), (ephy_encodings_get_list): * lib/ephy-encodings.h: * lib/ephy-langs.c: (ephy_lang_group_info_free), (lang_group_info_cmp), (ephy_lang_get_group_list), (fonts_language_info_cmp), (ephy_font_langs_get_codes_list), (ephy_font_langs_get_list): * lib/ephy-langs.h: * po/POTFILES.in: * src/ephy-encoding-menu.c: (ephy_encoding_menu_set_window), (ephy_encoding_menu_rebuild): * src/prefs-dialog.c: (prefs_dialog_finalize), (get_current_language_code), (create_fonts_language_menu), (default_encoding_menu_changed_cb), (find_encoding_in_list_cmp), (create_default_encoding_menu): Encodings menu improvements, part 3: Refactored the encodings list; it no longer is neccessary to have it in the embed single. Ported all callers to new infrastructure.
Diffstat (limited to 'embed/mozilla/mozilla-notifiers.cpp')
-rw-r--r--embed/mozilla/mozilla-notifiers.cpp43
1 files changed, 18 insertions, 25 deletions
diff --git a/embed/mozilla/mozilla-notifiers.cpp b/embed/mozilla/mozilla-notifiers.cpp
index 28049013b..0b170b555 100644
--- a/embed/mozilla/mozilla-notifiers.cpp
+++ b/embed/mozilla/mozilla-notifiers.cpp
@@ -387,8 +387,7 @@ mozilla_notifiers_init(EphyEmbedSingle *single)
{
GConfClient *client = eel_gconf_client_get_global ();
guint i;
- guint n_fonts_languages;
- const FontsLanguageInfo *fonts_language;
+ GList *codes, *l;
for (i = 0; conversion_table[i].gconf_key != NULL; i++)
{
@@ -426,10 +425,10 @@ mozilla_notifiers_init(EphyEmbedSingle *single)
}
/* fonts notifiers */
- n_fonts_languages = ephy_langs_get_n_font_languages ();
- fonts_language = ephy_langs_get_font_languages ();
- for (i = 0; i < n_fonts_languages; i++)
+ codes = ephy_font_langs_get_codes_list ();
+ for (l = codes; l != NULL; l = l->next)
{
+ const char *code = (char*) l->data;
guint k;
char *types [] = { "variable", "monospace" };
char key[255];
@@ -437,52 +436,46 @@ mozilla_notifiers_init(EphyEmbedSingle *single)
for (k = 0; k < G_N_ELEMENTS (types); k++)
{
- info = g_strconcat (types[k], ".", fonts_language[i].code, NULL);
+ info = g_strconcat (types[k], ".", code, NULL);
g_snprintf (key, 255, "%s_%s_%s", CONF_RENDERING_FONT,
- types[k],
- fonts_language[i].code);
+ types[k], code);
add_notification_and_notify (client, key,
(GConfClientNotifyFunc)mozilla_font_notifier,
info);
- font_infos = g_list_append (font_infos, info);
+ font_infos = g_list_prepend (font_infos, info);
}
- g_snprintf (key, 255, "%s_%s", CONF_RENDERING_FONT_MIN_SIZE, fonts_language[i].code);
- info = g_strconcat ("minimum-size", ".", fonts_language[i].code, NULL);
+ g_snprintf (key, 255, "%s_%s", CONF_RENDERING_FONT_MIN_SIZE, code);
+ info = g_strconcat ("minimum-size", ".", code, NULL);
add_notification_and_notify (client, key,
(GConfClientNotifyFunc)mozilla_font_size_notifier,
info);
- font_infos = g_list_append (font_infos, info);
+ font_infos = g_list_prepend (font_infos, info);
- g_snprintf (key, 255, "%s_%s", CONF_RENDERING_FONT_FIXED_SIZE, fonts_language[i].code);
- info = g_strconcat ("size.fixed", ".", fonts_language[i].code, NULL);
+ g_snprintf (key, 255, "%s_%s", CONF_RENDERING_FONT_FIXED_SIZE, code);
+ info = g_strconcat ("size.fixed", ".", code, NULL);
add_notification_and_notify (client, key,
(GConfClientNotifyFunc)mozilla_font_size_notifier,
info);
- font_infos = g_list_append (font_infos, info);
+ font_infos = g_list_prepend (font_infos, info);
- g_snprintf (key, 255, "%s_%s", CONF_RENDERING_FONT_VAR_SIZE, fonts_language[i].code);
- info = g_strconcat ("size.variable", ".", fonts_language[i].code, NULL);
+ g_snprintf (key, 255, "%s_%s", CONF_RENDERING_FONT_VAR_SIZE, code);
+ info = g_strconcat ("size.variable", ".", code, NULL);
add_notification_and_notify (client, key,
(GConfClientNotifyFunc)mozilla_font_size_notifier,
info);
- font_infos = g_list_append (font_infos, info);
+ font_infos = g_list_prepend (font_infos, info);
}
+ g_list_free (codes);
}
void
mozilla_notifiers_free (void)
{
- GList *l;
-
ephy_notification_remove (&mozilla_notifiers);
- for (l = font_infos; l != NULL; l = l->next)
- {
- g_free (l->data);
- }
-
+ g_list_foreach (font_infos, (GFunc) g_free, NULL);
g_list_free (font_infos);
}