Bug 1682939 - Remove nsISimpleEnumerator use in prplIPref. r=clokep
This commit is contained in:
Родитель
ff366afa90
Коммит
51a607ebaa
|
@ -5,6 +5,12 @@
|
|||
#include "nsISupports.idl"
|
||||
#include "nsISimpleEnumerator.idl"
|
||||
|
||||
[scriptable, uuid(8fc16882-ba8e-432a-999f-0d4dc104234b)]
|
||||
interface prplIKeyValuePair: nsISupports {
|
||||
readonly attribute AUTF8String name;
|
||||
readonly attribute AUTF8String value;
|
||||
};
|
||||
|
||||
/*
|
||||
* This is a proxy for libpurple PurpleAccountOption
|
||||
*/
|
||||
|
@ -25,14 +31,9 @@ interface prplIPref: nsISupports {
|
|||
long getInt();
|
||||
AUTF8String getString();
|
||||
/**
|
||||
* @returns enumerator of prplIKeyValuePair
|
||||
* @returns array of prplIKeyValuePair
|
||||
*/
|
||||
nsISimpleEnumerator getList();
|
||||
Array<prplIKeyValuePair> getList();
|
||||
AUTF8String getListDefault();
|
||||
};
|
||||
|
||||
[scriptable, uuid(8fc16882-ba8e-432a-999f-0d4dc104234b)]
|
||||
interface prplIKeyValuePair: nsISupports {
|
||||
readonly attribute AUTF8String name;
|
||||
readonly attribute AUTF8String value;
|
||||
};
|
||||
|
|
|
@ -1047,13 +1047,7 @@ purplePref.prototype = {
|
|||
getList() {
|
||||
// Convert a JavaScript object map {"value 1": "label 1", ...}
|
||||
let keys = Object.keys(this._listValues);
|
||||
if (!keys.length) {
|
||||
return EmptyEnumerator;
|
||||
}
|
||||
|
||||
return new nsSimpleEnumerator(
|
||||
keys.map(key => new purpleKeyValuePair(this._listValues[key], key))
|
||||
);
|
||||
return keys.map(key => new purpleKeyValuePair(this._listValues[key], key));
|
||||
},
|
||||
getListDefault() {
|
||||
return this._defaultValue;
|
||||
|
|
Загрузка…
Ссылка в новой задаче