mozilla-nongnome-proxies.patch
changeset 0 ad87c5e85a41
child 8 19a8c8d53349
equal deleted inserted replaced
-1:000000000000 0:ad87c5e85a41
       
     1 From: Wolfgang Rosenauer
       
     2 Subject: Do not use gconf for proxy settings if not running within Gnome
       
     3 
       
     4 
       
     5 Index: toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
       
     6 ===================================================================
       
     7 RCS file: /cvsroot/mozilla/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp,v
       
     8 retrieving revision 1.1
       
     9 diff -u -p -6 -r1.1 nsUnixSystemProxySettings.cpp
       
    10 --- toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp	29 Jan 2008 15:58:41 -0000	1.1
       
    11 +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp	17 Apr 2008 19:02:19 -0000
       
    12 @@ -69,13 +69,19 @@ private:
       
    13  
       
    14  NS_IMPL_ISUPPORTS1(nsUnixSystemProxySettings, nsISystemProxySettings)
       
    15  
       
    16  nsresult
       
    17  nsUnixSystemProxySettings::Init()
       
    18  {
       
    19 -  mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
       
    20 +  // If this is a GNOME session, load gconf and try to use its preferences.
       
    21 +  // If gconf is not available (which would be stupid) we'll proceed as if
       
    22 +  // this was not a GNOME session, using *_PROXY environment variables.
       
    23 +  const char* sessionType = PR_GetEnv("DESKTOP_SESSION");
       
    24 +  if (sessionType && !strcmp(sessionType, "gnome")) {
       
    25 +    mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
       
    26 +  }
       
    27    return NS_OK;
       
    28  }
       
    29  
       
    30  PRBool
       
    31  nsUnixSystemProxySettings::IsProxyMode(const char* aMode)
       
    32  {