Fix global flag on Zotero.Prefs.get()
This commit is contained in:
parent
7e5ec21781
commit
204f9563c6
|
@ -1926,19 +1926,20 @@ Zotero.Prefs = new function(){
|
||||||
try {
|
try {
|
||||||
if (global) {
|
if (global) {
|
||||||
var service = Components.classes["@mozilla.org/preferences-service;1"]
|
var service = Components.classes["@mozilla.org/preferences-service;1"]
|
||||||
.getService(Components.interfaces.nsIPrefService);
|
.getService(Components.interfaces.nsIPrefService);
|
||||||
|
var branch = service.getBranch("");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var service = this.prefBranch;
|
var branch = this.prefBranch;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (this.prefBranch.getPrefType(pref)){
|
switch (branch.getPrefType(pref)){
|
||||||
case this.prefBranch.PREF_BOOL:
|
case branch.PREF_BOOL:
|
||||||
return this.prefBranch.getBoolPref(pref);
|
return branch.getBoolPref(pref);
|
||||||
case this.prefBranch.PREF_STRING:
|
case branch.PREF_STRING:
|
||||||
return this.prefBranch.getCharPref(pref);
|
return branch.getCharPref(pref);
|
||||||
case this.prefBranch.PREF_INT:
|
case branch.PREF_INT:
|
||||||
return this.prefBranch.getIntPref(pref);
|
return branch.getIntPref(pref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e){
|
catch (e){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user