mozilla-nongnome-proxies.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Mon, 30 Nov 2009 08:50:50 +0100
changeset 8 19a8c8d53349
parent 0 ad87c5e85a41
child 367 3fabd9f66322
permissions -rw-r--r--
Fixed patch comments
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     1
From: Wolfgang Rosenauer
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     2
Subject: Do not use gconf for proxy settings if not running within Gnome
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     3
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     4
Index: toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     5
===================================================================
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     6
RCS file: /cvsroot/mozilla/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp,v
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     7
retrieving revision 1.1
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     8
diff -u -p -6 -r1.1 nsUnixSystemProxySettings.cpp
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     9
--- toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp	29 Jan 2008 15:58:41 -0000	1.1
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    10
+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp	17 Apr 2008 19:02:19 -0000
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    11
@@ -69,13 +69,19 @@ private:
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    12
 
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    13
 NS_IMPL_ISUPPORTS1(nsUnixSystemProxySettings, nsISystemProxySettings)
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    14
 
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    15
 nsresult
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    16
 nsUnixSystemProxySettings::Init()
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    17
 {
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    18
-  mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    19
+  // If this is a GNOME session, load gconf and try to use its preferences.
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    20
+  // If gconf is not available (which would be stupid) we'll proceed as if
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    21
+  // this was not a GNOME session, using *_PROXY environment variables.
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    22
+  const char* sessionType = PR_GetEnv("DESKTOP_SESSION");
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    23
+  if (sessionType && !strcmp(sessionType, "gnome")) {
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    24
+    mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    25
+  }
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    26
   return NS_OK;
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    27
 }
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    28
 
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    29
 PRBool
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    30
 nsUnixSystemProxySettings::IsProxyMode(const char* aMode)
ad87c5e85a41 patch status 20091128
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    31
 {