From 204f9563c6bced5b5988549554c762004b157887 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 5 Jan 2012 19:05:50 -0500 Subject: [PATCH] Fix global flag on Zotero.Prefs.get() --- chrome/content/zotero/xpcom/zotero.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index fb038859d1..4cc1c555aa 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -1926,19 +1926,20 @@ Zotero.Prefs = new function(){ try { if (global) { var service = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefService); + .getService(Components.interfaces.nsIPrefService); + var branch = service.getBranch(""); } else { - var service = this.prefBranch; + var branch = this.prefBranch; } - switch (this.prefBranch.getPrefType(pref)){ - case this.prefBranch.PREF_BOOL: - return this.prefBranch.getBoolPref(pref); - case this.prefBranch.PREF_STRING: - return this.prefBranch.getCharPref(pref); - case this.prefBranch.PREF_INT: - return this.prefBranch.getIntPref(pref); + switch (branch.getPrefType(pref)){ + case branch.PREF_BOOL: + return branch.getBoolPref(pref); + case branch.PREF_STRING: + return branch.getCharPref(pref); + case branch.PREF_INT: + return branch.getIntPref(pref); } } catch (e){