diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-05-06 19:08:45 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-05-06 19:08:45 +0800 |
commit | 0844abeea1ba193d4c9aa9afdbd9aaddba459d17 (patch) | |
tree | 66bac3ea6730f272ee3429b3fd75e5e15d994829 /embed/mozilla | |
parent | 9902a5b9f55a904589bc7651722445d1bde3a2ef (diff) | |
download | gsoc2013-epiphany-0844abeea1ba193d4c9aa9afdbd9aaddba459d17.tar gsoc2013-epiphany-0844abeea1ba193d4c9aa9afdbd9aaddba459d17.tar.gz gsoc2013-epiphany-0844abeea1ba193d4c9aa9afdbd9aaddba459d17.tar.bz2 gsoc2013-epiphany-0844abeea1ba193d4c9aa9afdbd9aaddba459d17.tar.lz gsoc2013-epiphany-0844abeea1ba193d4c9aa9afdbd9aaddba459d17.tar.xz gsoc2013-epiphany-0844abeea1ba193d4c9aa9afdbd9aaddba459d17.tar.zst gsoc2013-epiphany-0844abeea1ba193d4c9aa9afdbd9aaddba459d17.zip |
Remove proxy prefs initialization. Now we call the gconf notifier on
2003-05-06 Marco Pesenti Gritti <marco@it.gnome.org>
* embed/mozilla/mozilla-embed-single.cpp:
Remove proxy prefs initialization. Now we call the gconf
notifier on startup for all mozilla prefs, so it should
be no more necessary.
* embed/mozilla/mozilla-notifiers.cpp:
Fix a nice infinite loop with EmbedSingle being shell_get from
his _init. General cleanup of that code. Galeon1 code is so messy :/
Diffstat (limited to 'embed/mozilla')
-rw-r--r-- | embed/mozilla/mozilla-embed-single.cpp | 68 | ||||
-rw-r--r-- | embed/mozilla/mozilla-notifiers.cpp | 42 |
2 files changed, 20 insertions, 90 deletions
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index e752af11e..d65a4fffa 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -181,72 +181,6 @@ mozilla_embed_single_class_init (MozillaEmbedSingleClass *klass) } static void -mozilla_load_proxy_prefs (MozillaEmbedSingle *shell) -{ - char *tmp; - int i, mozilla_mode = 0; - - /* Proxy mode */ - tmp = eel_gconf_get_string (CONF_NETWORK_PROXY_MODE); - g_return_if_fail (tmp != NULL); - - if (strcmp (tmp, "manual") == 0) - { - mozilla_mode = 1; - } - else if (strcmp (tmp, "auto") == 0) - { - mozilla_mode = 2; - } - - mozilla_prefs_set_int ("network.proxy.type", mozilla_mode); - g_free (tmp); - - /* Http proxy */ - tmp = eel_gconf_get_string (CONF_NETWORK_HTTP_PROXY); - g_return_if_fail (tmp != NULL); - mozilla_prefs_set_string ("network.proxy.http", tmp); - g_free (tmp); - - i = eel_gconf_get_integer (CONF_NETWORK_HTTP_PROXY_PORT); - mozilla_prefs_set_int ("network.proxy.http_port", i); - - /* Ftp proxy */ - tmp = eel_gconf_get_string (CONF_NETWORK_FTP_PROXY); - g_return_if_fail (tmp != NULL); - mozilla_prefs_set_string ("network.proxy.ftp", tmp); - g_free (tmp); - - i = eel_gconf_get_integer (CONF_NETWORK_FTP_PROXY_PORT); - mozilla_prefs_set_int ("network.proxy.ftp_port", i); - - /* Secure proxy */ - tmp = eel_gconf_get_string (CONF_NETWORK_SSL_PROXY); - g_return_if_fail (tmp != NULL); - mozilla_prefs_set_string ("network.proxy.ssl", tmp); - g_free (tmp); - - i = eel_gconf_get_integer (CONF_NETWORK_SSL_PROXY_PORT); - mozilla_prefs_set_int ("network.proxy.ssl_port", i); - - /* Socks proxy */ - tmp = eel_gconf_get_string (CONF_NETWORK_SOCKS_PROXY); - g_return_if_fail (tmp != NULL); - mozilla_prefs_set_string ("network.proxy.socks", tmp); - g_free (tmp); - - i = eel_gconf_get_integer (CONF_NETWORK_SOCKS_PROXY_PORT); - mozilla_prefs_set_int ("network.proxy.socks_port", i); - - /* Autoconfiguration */ - tmp = eel_gconf_get_string (CONF_NETWORK_PROXY_AUTO_URL); - g_return_if_fail (tmp != NULL); - ephy_embed_single_load_proxy_autoconf - (EPHY_EMBED_SINGLE (shell), tmp); - g_free (tmp); -} - -static void mozilla_set_default_prefs (MozillaEmbedSingle *mes) { mozilla_prefs_load (ephy_file ("default-prefs.js")); @@ -354,8 +288,6 @@ mozilla_embed_single_init (MozillaEmbedSingle *mes) mozilla_set_default_prefs (mes); - mozilla_load_proxy_prefs (mes); - START_PROFILER ("Mozilla prefs notifiers") mozilla_notifiers_init (EPHY_EMBED_SINGLE (mes)); STOP_PROFILER ("Mozilla prefs notifiers") diff --git a/embed/mozilla/mozilla-notifiers.cpp b/embed/mozilla/mozilla-notifiers.cpp index 674e541df..8c7364516 100644 --- a/embed/mozilla/mozilla-notifiers.cpp +++ b/embed/mozilla/mozilla-notifiers.cpp @@ -40,18 +40,18 @@ static void mozilla_own_colors_notifier(GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data); + EphyEmbedSingle *single); static void mozilla_own_fonts_notifier(GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data); + EphyEmbedSingle *single); static void mozilla_animate_notifier(GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data); + EphyEmbedSingle *single); static void generic_mozilla_string_notifier(GConfClient *client, guint cnxn_id, @@ -71,13 +71,13 @@ static void mozilla_allow_popups_notifier(GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data); + EphyEmbedSingle *single); static void mozilla_language_notifier(GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data); + EphyEmbedSingle *single); static void mozilla_autodetect_charset_notifier(GConfClient *client, @@ -89,24 +89,24 @@ static void mozilla_default_font_notifier(GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data); + EphyEmbedSingle *single); static void mozilla_proxy_mode_notifier (GConfClient *client, guint cnxn_id, GConfEntry *entry, - char *pref); + EphyEmbedSingle *single); static void mozilla_proxy_autoconfig_notifier (GConfClient *client, guint cnxn_id, GConfEntry *entry, - char *pref); + EphyEmbedSingle *single); static void mozilla_user_agent_notifier(GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data); + EphyEmbedSingle *single); static void mozilla_default_charset_notifier (GConfClient *client, @@ -117,7 +117,7 @@ static void mozilla_socks_version_notifier (GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data); + EphyEmbedSingle *single); /* Keeps the list of the notifiers we installed for mozilla prefs */ /* to be able to remove them when exiting */ @@ -219,7 +219,7 @@ static void mozilla_proxy_mode_notifier (GConfClient *client, guint cnxn_id, GConfEntry *entry, - char *pref) + EphyEmbedSingle *single) { const char *mode; int mozilla_mode = 0; @@ -255,10 +255,8 @@ static void mozilla_proxy_autoconfig_notifier (GConfClient *client, guint cnxn_id, GConfEntry *entry, - char *pref) + EphyEmbedSingle *single) { - EphyEmbedSingle *single; - single = ephy_embed_shell_get_embed_single (embed_shell); ephy_embed_single_load_proxy_autoconf (single, gconf_value_get_string(entry->value)); } @@ -495,7 +493,7 @@ static void mozilla_own_colors_notifier(GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data) + EphyEmbedSingle *single) { mozilla_prefs_set_boolean("browser.display.use_document_colors", !gconf_value_get_bool(entry->value)); @@ -505,7 +503,7 @@ static void mozilla_own_fonts_notifier(GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data) + EphyEmbedSingle *single) { mozilla_prefs_set_int("browser.display.use_document_fonts", !gconf_value_get_bool(entry->value)); @@ -515,7 +513,7 @@ static void mozilla_animate_notifier(GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data) + EphyEmbedSingle *single) { static const gchar *type[] = { @@ -532,7 +530,7 @@ static void mozilla_allow_popups_notifier(GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data) + EphyEmbedSingle *single) { gboolean new_val = eel_gconf_get_boolean(CONF_FILTERING_ALLOW_POPUPS); mozilla_prefs_set_boolean ("dom.disable_open_during_load", @@ -543,7 +541,7 @@ static void mozilla_language_notifier(GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data) + EphyEmbedSingle *single) { gchar *languages; GSList *language_list ,*cur_lang_list; @@ -616,7 +614,7 @@ static void mozilla_default_font_notifier(GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data) + EphyEmbedSingle *single) { const gchar *font_types [] = {"serif","sans-serif"}; int default_font; @@ -686,7 +684,7 @@ static void mozilla_user_agent_notifier (GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data) + EphyEmbedSingle *single) { switch (entry->value->type) { @@ -704,7 +702,7 @@ static void mozilla_socks_version_notifier (GConfClient *client, guint cnxn_id, GConfEntry *entry, - gpointer user_data) + EphyEmbedSingle *single) { int version; version = gconf_value_get_int(entry->value) + 4; |