commit 8444a4d8b490dadb75399b2bb193d48d3d54d400
parent e7710660efb36c7ccfa58975d806b98f94fcd456
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 20 Mar 2014 17:01:42 -0400
Allow Unicode characters in string prefs, including sync username
Diffstat:
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/preferences/preferences_sync.xul b/chrome/content/zotero/preferences/preferences_sync.xul
@@ -31,7 +31,7 @@
helpTopic="sync">
<preferences>
<preference id="pref-sync-autosync" name="extensions.zotero.sync.autoSync" type="bool"/>
- <preference id="pref-sync-username" name="extensions.zotero.sync.server.username" type="string" instantApply="true"/>
+ <preference id="pref-sync-username" name="extensions.zotero.sync.server.username" type="unichar" instantApply="true"/>
<preference id="pref-sync-fulltext-enabled" name="extensions.zotero.sync.fulltext.enabled" type="bool"/>
<preference id="pref-storage-enabled" name="extensions.zotero.sync.storage.enabled" type="bool"/>
<preference id="pref-storage-protocol" name="extensions.zotero.sync.storage.protocol" type="string"
diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js
@@ -2184,7 +2184,10 @@ Zotero.Prefs = new function(){
case this.prefBranch.PREF_BOOL:
return this.prefBranch.setBoolPref(pref, value);
case this.prefBranch.PREF_STRING:
- return this.prefBranch.setCharPref(pref, value);
+ let str = Cc["@mozilla.org/supports-string;1"]
+ .createInstance(Ci.nsISupportsString);
+ str.data = value;
+ return this.prefBranch.setComplexValue(pref, Ci.nsISupportsString, str);
case this.prefBranch.PREF_INT:
return this.prefBranch.setIntPref(pref, value);
@@ -2205,7 +2208,9 @@ Zotero.Prefs = new function(){
throw ("Invalid preference value '" + value + "' for pref '" + pref + "'");
}
}
- catch (e){
+ catch (e) {
+ Components.utils.reportError(e);
+ Zotero.debug(e, 1);
throw ("Invalid preference '" + pref + "'");
}
}