Bug 424626 - "(linux) Firefox is put into offline mode on startup when NetworkManager is running but not controlling the active network interface (e.g. when using PPP)" [p=mozilla@rosenauer.org (Wolfgang Rosenauer) r=roc a=beltzner]

git-svn-id: svn://10.0.0.236/trunk@252730 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
reed%reedloden.com 2008-07-01 06:15:22 +00:00
parent 38ffde4cfb
commit 8b96c7b0cf

View File

@ -45,6 +45,8 @@
#include "nsServiceManagerUtils.h"
#include "nsIObserverService.h"
#include "nsStringAPI.h"
#include "nsIPrefBranch2.h"
#include "nsIPrefService.h"
// Define NetworkManager API constants. This avoids a dependency on
// NetworkManager-devel.
@ -187,7 +189,17 @@ nsNetworkManagerListener::UpdateNetworkStatus(DBusMessage* msg) {
if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32, &result,
DBUS_TYPE_INVALID))
return;
// Don't update status if disabled by pref
nsCOMPtr<nsIPrefBranch2> prefs =
do_GetService(NS_PREFSERVICE_CONTRACTID);
if (prefs) {
PRBool ignore = PR_FALSE;
prefs->GetBoolPref("toolkit.networkmanager.disable", &ignore);
if (ignore)
return;
}
mNetworkManagerActive = PR_TRUE;
PRBool wasUp = mLinkUp;