mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-24 02:42:25 +01:00
Fix: set! foo="multibyte string" was broken.
This commit is contained in:
@@ -335,7 +335,11 @@ function Options() //{{{
|
|||||||
{
|
{
|
||||||
case "string":
|
case "string":
|
||||||
if (type == Ci.nsIPrefBranch.PREF_INVALID || type == Ci.nsIPrefBranch.PREF_STRING)
|
if (type == Ci.nsIPrefBranch.PREF_INVALID || type == Ci.nsIPrefBranch.PREF_STRING)
|
||||||
services.get("pref").setCharPref(name, value);
|
{
|
||||||
|
let supportString = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
|
||||||
|
supportString.data = value;
|
||||||
|
services.get("pref").setComplexValue(name, Ci.nsISupportsString, supportString);
|
||||||
|
}
|
||||||
else if (type == Ci.nsIPrefBranch.PREF_INT)
|
else if (type == Ci.nsIPrefBranch.PREF_INT)
|
||||||
liberator.echoerr("E521: Number required after =: " + name + "=" + value);
|
liberator.echoerr("E521: Number required after =: " + name + "=" + value);
|
||||||
else
|
else
|
||||||
@@ -375,6 +379,7 @@ function Options() //{{{
|
|||||||
case Ci.nsIPrefBranch.PREF_STRING:
|
case Ci.nsIPrefBranch.PREF_STRING:
|
||||||
let value = branch.getComplexValue(name, Ci.nsISupportsString).data;
|
let value = branch.getComplexValue(name, Ci.nsISupportsString).data;
|
||||||
// try in case it's a localized string (will throw an exception if not)
|
// try in case it's a localized string (will throw an exception if not)
|
||||||
|
//
|
||||||
if (!services.get("pref").prefIsLocked(name) && !services.get("pref").prefHasUserValue(name) &&
|
if (!services.get("pref").prefIsLocked(name) && !services.get("pref").prefHasUserValue(name) &&
|
||||||
RegExp("chrome://.+/locale/.+\\.properties").test(value))
|
RegExp("chrome://.+/locale/.+\\.properties").test(value))
|
||||||
value = branch.getComplexValue(name, Ci.nsIPrefLocalizedString).data;
|
value = branch.getComplexValue(name, Ci.nsIPrefLocalizedString).data;
|
||||||
|
|||||||
Reference in New Issue
Block a user