0
|
1 |
From: Wolfgang Rosenauer
|
|
2 |
Subject: Do not use gconf for proxy settings if not running within Gnome
|
|
3 |
|
|
4 |
Index: toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
|
|
5 |
===================================================================
|
|
6 |
RCS file: /cvsroot/mozilla/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp,v
|
|
7 |
retrieving revision 1.1
|
367
|
8 |
|
|
9 |
diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
|
|
10 |
--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
|
|
11 |
+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
|
|
12 |
@@ -68,16 +68,23 @@ private:
|
|
13 |
};
|
0
|
14 |
|
|
15 |
NS_IMPL_ISUPPORTS1(nsUnixSystemProxySettings, nsISystemProxySettings)
|
|
16 |
|
|
17 |
nsresult
|
|
18 |
nsUnixSystemProxySettings::Init()
|
|
19 |
{
|
367
|
20 |
mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
|
0
|
21 |
+ // If this is a GNOME session, load gconf and try to use its preferences.
|
|
22 |
+ // If gconf is not available (which would be stupid) we'll proceed as if
|
|
23 |
+ // this was not a GNOME session, using *_PROXY environment variables.
|
|
24 |
+ const char* sessionType = PR_GetEnv("DESKTOP_SESSION");
|
|
25 |
+ if (sessionType && !strcmp(sessionType, "gnome")) {
|
|
26 |
+ mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
|
|
27 |
+ }
|
|
28 |
return NS_OK;
|
|
29 |
}
|
|
30 |
|
367
|
31 |
bool
|
0
|
32 |
nsUnixSystemProxySettings::IsProxyMode(const char* aMode)
|
|
33 |
{
|
367
|
34 |
nsCAutoString mode;
|
|
35 |
return NS_SUCCEEDED(mGConf->GetString(NS_LITERAL_CSTRING("/system/proxy/mode"), mode)) &&
|