зеркало из https://github.com/mozilla/snowl.git
rename the Collection2 object to the more descriptive StorageCollection
This commit is contained in:
Родитель
5cb834f06a
Коммит
7e2d4198f4
|
@ -921,8 +921,8 @@ let Sources = {
|
|||
|
||||
// XXX replace this with a SnowlSource::retrieve method that handles
|
||||
// constraints (and ultimately multiple source IDs)?
|
||||
messages = new Collection2({ constraints: constraints,
|
||||
order: "messages.id DESC" });
|
||||
messages = new StorageCollection({ constraints: constraints,
|
||||
order: "messages.id DESC" });
|
||||
}
|
||||
else {
|
||||
// This source is not stored, but we haven't retrieved its messages yet,
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
let EXPORTED_SYMBOLS = ["Collection2"];
|
||||
let EXPORTED_SYMBOLS = ["StorageCollection"];
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
@ -66,11 +66,11 @@ Cu.import("resource://snowl/modules/utils.js");
|
|||
* will retrieve messages without blocking execution of events on the same
|
||||
* thread, although the call will appear synchronous to the caller.
|
||||
*
|
||||
* let collection = new Collection2();
|
||||
* let collection = new StorageCollection();
|
||||
* for each (let message in collection)
|
||||
* dump("retrieved message " + message.id + "\n");
|
||||
*/
|
||||
function Collection2(args) {
|
||||
function StorageCollection(args) {
|
||||
// Extract values from arguments and assign them to member properties.
|
||||
this.constraints = "constraints" in args ? args.constraints : [];
|
||||
if ("order" in args) this.order = args.order;
|
||||
|
@ -80,7 +80,7 @@ function Collection2(args) {
|
|||
Sync(this.execute, this)();
|
||||
}
|
||||
|
||||
Collection2.prototype = {
|
||||
StorageCollection.prototype = {
|
||||
//**************************************************************************//
|
||||
// Properties
|
||||
|
||||
|
@ -110,7 +110,7 @@ Collection2.prototype = {
|
|||
// Shortcuts
|
||||
|
||||
get _log() {
|
||||
let log = Log4Moz.repository.getLogger("Snowl.Collection2");
|
||||
let log = Log4Moz.repository.getLogger("Snowl.StorageCollection");
|
||||
this.__defineGetter__("_log", function() log);
|
||||
return this._log;
|
||||
},
|
||||
|
@ -230,7 +230,7 @@ Collection2.prototype = {
|
|||
* An iterator across the messages in the collection. Allows callers
|
||||
* to iterate messages via |for each... in|, i.e.:
|
||||
*
|
||||
* let collection = new Collection2();
|
||||
* let collection = new StorageCollection();
|
||||
* for each (let message in collection) ...
|
||||
*/
|
||||
__iterator__: function(wantKeys) {
|
||||
|
|
|
@ -27,7 +27,7 @@ function run_test() {
|
|||
|
||||
function continue_test() {
|
||||
feed.persist();
|
||||
let collection = new Collection2();
|
||||
let collection = new StorageCollection();
|
||||
|
||||
for each (let message in collection) {
|
||||
do_check_eq(message.id.constructor.name, "Number");
|
||||
|
|
Загрузка…
Ссылка в новой задаче