Added PrefHasUserPref functionality. r=bnesse, sr=alecf, a=asa. Checking in for Chip C.

git-svn-id: svn://10.0.0.236/trunk@96733 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bnesse%netscape.com
2001-06-08 20:31:34 +00:00
parent 9d44db3c48
commit 0d82929ca0
3 changed files with 25 additions and 0 deletions

View File

@@ -85,6 +85,7 @@ interface nsIPrefBranch : nsISupports
*/
void lockPref(in string aPrefName);
boolean prefHasUserValue(in string aPrefName);
boolean prefIsLocked(in string aPrefName);
void unlockPref(in string aPrefName);

View File

@@ -296,6 +296,16 @@ NS_IMETHODIMP nsPref::PrefIsLocked(const char *aPrefName, PRBool *_retval)
return rv;
}
NS_IMETHODIMP nsPref::PrefHasUserValue(const char *aPrefName, PRBool *_retval)
{
nsresult rv;
nsCOMPtr<nsIPrefBranch> prefBranch = do_QueryInterface(mPrefService, &rv);
if (NS_SUCCEEDED(rv))
rv = prefBranch->PrefHasUserValue(aPrefName, _retval);
return rv;
}
NS_IMETHODIMP nsPref::UnlockPref(const char *aPrefName)
{
nsresult rv;

View File

@@ -429,6 +429,20 @@ NS_IMETHODIMP nsPrefBranch::ClearUserPref(const char *aPrefName)
return rv;
}
NS_IMETHODIMP nsPrefBranch::PrefHasUserValue(const char *aPrefName, PRBool *_retval)
{
const char *pref = getPrefName(aPrefName);
nsresult rv;
NS_ENSURE_ARG_POINTER(_retval);
rv = QueryObserver(pref);
if (NS_SUCCEEDED(rv)) {
*_retval = PREF_HasUserPref(pref);
}
return rv;
}
NS_IMETHODIMP nsPrefBranch::LockPref(const char *aPrefName)
{
const char *pref = getPrefName(aPrefName);