Bug 424626 - Add a pref to make it possible to ignore NetworkManager's network status events, r=roc

This commit is contained in:
Wolfgang Rosenauer 2008-06-12 23:10:57 +02:00
Родитель b3cc1e062d
Коммит 6d5feb7559
1 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -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.
@ -188,6 +190,16 @@ nsNetworkManagerListener::UpdateNetworkStatus(DBusMessage* msg) {
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;