fix bug 290435 proxy settings are disabled after switching profiles.

alecf: review+
neil.parkwaycc.co.uk: superreview+
patched by Boying Lu <brian.lu@sun.com>
This commit is contained in:
robin.lu%sun.com 2005-04-30 02:37:41 +00:00
Родитель 844e7f7324
Коммит cfe21df0aa
1 изменённых файлов: 11 добавлений и 2 удалений

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

@ -122,6 +122,8 @@ nsSystemPref::Init(void)
if (observerService) {
rv = observerService->AddObserver(this, NS_PREFSERVICE_READ_TOPIC_ID,
PR_FALSE);
rv = observerService->AddObserver(this, "profile-before-change",
PR_FALSE);
SYSPREF_LOG(("Add Observer for %s\n", NS_PREFSERVICE_READ_TOPIC_ID));
}
return(rv);
@ -211,8 +213,15 @@ nsSystemPref::Observe(nsISupports *aSubject,
aTopic, (char*)aData));
rv = ReadSystemPref(NS_LossyConvertUCS2toASCII(aData).get());
return NS_OK;
}
else
} else if (!nsCRT::strcmp(aTopic,"profile-before-change")) {
//roll back to mozilla prefs
if (mEnabled)
UseMozillaPrefs();
mEnabled = PR_FALSE;
mSysPrefService = nsnull;
delete [] mSysPrefs;
mSysPrefs = nsnull;
} else
SYSPREF_LOG(("Not needed topic Received %s\n", aTopic));
return rv;
}