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