author | Wolfgang Rosenauer <wr@rosenauer.org> |
Fri, 25 May 2012 09:30:17 +0200 | |
branch | firefox13 |
changeset 454 | 1abfe992b1fc |
parent 419 | f6b055dd94bc |
child 568 | 2c74c5927ea2 |
permissions | -rw-r--r-- |
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 |
|
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
12 |
@@ -74,22 +74,28 @@ private: |
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
13 |
nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType, nsACString& aResult); |
367 | 14 |
}; |
0 | 15 |
|
16 |
NS_IMPL_ISUPPORTS1(nsUnixSystemProxySettings, nsISystemProxySettings) |
|
17 |
||
18 |
nsresult |
|
19 |
nsUnixSystemProxySettings::Init() |
|
20 |
{ |
|
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
21 |
- mSchemeProxySettings.Init(5); |
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
22 |
- mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID); |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
23 |
- mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
24 |
- if (mGSettings) { |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
25 |
- mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"), |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
26 |
- getter_AddRefs(mProxySettings)); |
0 | 27 |
+ // If this is a GNOME session, load gconf and try to use its preferences. |
28 |
+ // If gconf is not available (which would be stupid) we'll proceed as if |
|
29 |
+ // this was not a GNOME session, using *_PROXY environment variables. |
|
30 |
+ const char* sessionType = PR_GetEnv("DESKTOP_SESSION"); |
|
31 |
+ if (sessionType && !strcmp(sessionType, "gnome")) { |
|
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
32 |
+ mSchemeProxySettings.Init(5); |
0 | 33 |
+ mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID); |
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
34 |
+ mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
35 |
+ if (mGSettings) { |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
36 |
+ mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"), |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
37 |
+ getter_AddRefs(mProxySettings)); |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
38 |
+ } |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
39 |
} |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
40 |
|
0 | 41 |
return NS_OK; |
42 |
} |
|
43 |
||
367 | 44 |
bool |
0 | 45 |
nsUnixSystemProxySettings::IsProxyMode(const char* aMode) |
46 |
{ |