mozilla-nongnome-proxies.patch
changeset 382 67f876aafae8
parent 367 3fabd9f66322
child 419 f6b055dd94bc
equal deleted inserted replaced
380:0887a88b1e85 382:67f876aafae8
     7 retrieving revision 1.1
     7 retrieving revision 1.1
     8 
     8 
     9 diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
     9 diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
    10 --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
    10 --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
    11 +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
    11 +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
    12 @@ -68,16 +68,23 @@ private:
    12 @@ -71,18 +71,24 @@ private:
       
    13    nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType, nsACString& aResult);
    13  };
    14  };
    14  
    15  
    15  NS_IMPL_ISUPPORTS1(nsUnixSystemProxySettings, nsISystemProxySettings)
    16  NS_IMPL_ISUPPORTS1(nsUnixSystemProxySettings, nsISystemProxySettings)
    16  
    17  
    17  nsresult
    18  nsresult
    18  nsUnixSystemProxySettings::Init()
    19  nsUnixSystemProxySettings::Init()
    19  {
    20  {
    20    mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
    21 -  mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
       
    22 -  mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
    21 +  // If this is a GNOME session, load gconf and try to use its preferences.
    23 +  // 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
    24 +  // 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.
    25 +  // this was not a GNOME session, using *_PROXY environment variables.
    24 +  const char* sessionType = PR_GetEnv("DESKTOP_SESSION");
    26 +  const char* sessionType = PR_GetEnv("DESKTOP_SESSION");
    25 +  if (sessionType && !strcmp(sessionType, "gnome")) {
    27 +  if (sessionType && !strcmp(sessionType, "gnome")) {
    26 +    mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
    28 +    mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
       
    29 +    mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
    27 +  }
    30 +  }
    28    return NS_OK;
    31    return NS_OK;
    29  }
    32  }
    30  
    33  
    31  bool
    34  bool