aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-08-12 00:35:06 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-08-12 00:35:06 +0800
commitf36ca5abdf24b9562532e8743e6069dcb85866f5 (patch)
tree65eeed5c0995537e20b99ed27928eee9d0b501f8 /embed/mozilla
parent3afeffbe432a665ca4e888b387156944f5cf5ff0 (diff)
downloadgsoc2013-epiphany-f36ca5abdf24b9562532e8743e6069dcb85866f5.tar
gsoc2013-epiphany-f36ca5abdf24b9562532e8743e6069dcb85866f5.tar.gz
gsoc2013-epiphany-f36ca5abdf24b9562532e8743e6069dcb85866f5.tar.bz2
gsoc2013-epiphany-f36ca5abdf24b9562532e8743e6069dcb85866f5.tar.lz
gsoc2013-epiphany-f36ca5abdf24b9562532e8743e6069dcb85866f5.tar.xz
gsoc2013-epiphany-f36ca5abdf24b9562532e8743e6069dcb85866f5.tar.zst
gsoc2013-epiphany-f36ca5abdf24b9562532e8743e6069dcb85866f5.zip
Respect system pref about no proxy for.
2003-08-11 Marco Pesenti Gritti <marco@it.gnome.org> * embed/ephy-embed-prefs.h: * embed/mozilla/mozilla-notifiers.cpp: Respect system pref about no proxy for.
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/mozilla-notifiers.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/embed/mozilla/mozilla-notifiers.cpp b/embed/mozilla/mozilla-notifiers.cpp
index e267d3423..6c46fe55e 100644
--- a/embed/mozilla/mozilla-notifiers.cpp
+++ b/embed/mozilla/mozilla-notifiers.cpp
@@ -39,6 +39,8 @@
#include "nsIPrefService.h"
#include "nsIServiceManager.h"
+#define MOZILLA_PREF_NO_PROXIES "network.proxy.no_proxies_on"
+
static void
mozilla_cache_size_notifier (GConfClient *client,
guint cnxn_id,
@@ -102,6 +104,11 @@ mozilla_cookies_accept_notifier (GConfClient *client,
guint cnxn_id,
GConfEntry *entry,
char *pref);
+static void
+mozilla_proxy_ignore_notifier (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ EphyEmbedSingle *single);
/* Keeps the list of the notifiers we installed for mozilla prefs */
/* to be able to remove them when exiting */
@@ -162,6 +169,8 @@ custom_notifiers [] =
(GConfClientNotifyFunc) mozilla_cache_size_notifier },
{ CONF_SECURITY_COOKIES_ACCEPT,
(GConfClientNotifyFunc) mozilla_cookies_accept_notifier },
+ { CONF_NETWORK_PROXY_IGNORE_HOSTS,
+ (GConfClientNotifyFunc) mozilla_proxy_ignore_notifier },
{ NULL, NULL }
};
@@ -661,3 +670,39 @@ mozilla_language_notifier(GConfClient *client,
g_slist_foreach (languages, (GFunc) g_free, NULL);
g_slist_free (languages);
}
+
+static void
+mozilla_proxy_ignore_notifier (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ EphyEmbedSingle *single)
+{
+ GSList *hosts, *l;
+ char **strings, *mozilla_ignore_list;
+ int i = 0;
+
+ hosts = eel_gconf_get_string_list (entry->key);
+
+ strings = g_new (gchar*, g_slist_length (hosts) + 1);
+ for (l = hosts; l != NULL; l = l->next)
+ {
+ char *item = (char *) l->data;
+
+ if (item && item[0] != '\0')
+ {
+ strings[i] = item;
+ i++;
+ }
+ }
+ strings[i] = NULL;
+
+ mozilla_ignore_list = g_strjoinv (", ", strings);
+ mozilla_prefs_set_string (MOZILLA_PREF_NO_PROXIES,
+ mozilla_ignore_list);
+
+ g_free (mozilla_ignore_list);
+ g_free (strings);
+ g_slist_foreach (hosts, (GFunc) g_free, NULL);
+ g_slist_free (hosts);
+}
+