aboutsummaryrefslogtreecommitdiffstats
path: root/embed
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
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')
-rw-r--r--embed/ephy-embed-prefs.h2
-rw-r--r--embed/mozilla/mozilla-notifiers.cpp45
2 files changed, 46 insertions, 1 deletions
diff --git a/embed/ephy-embed-prefs.h b/embed/ephy-embed-prefs.h
index 707829d00..50e63bdb7 100644
--- a/embed/ephy-embed-prefs.h
+++ b/embed/ephy-embed-prefs.h
@@ -25,4 +25,4 @@
#define CONF_NETWORK_FTP_PROXY_PORT "/system/proxy/ftp_port"
#define CONF_NETWORK_SOCKS_PROXY_PORT "/system/proxy/socks_port"
#define CONF_NETWORK_PROXY_AUTO_URL "/system/proxy/autoconfig_url"
-
+#define CONF_NETWORK_PROXY_IGNORE_HOSTS "/system/http_proxy/ignore_hosts"
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);
+}
+