add a method to wrap a depth-only record (just depth and guid, nothing else)
authorDan Mills <thunder@mozilla.com>
Tue, 23 Dec 2008 11:22:29 -0800
changeset 45132 13213ab2945d5a5032760adb9b5a59cb50bcd9a9
parent 45131 634eac01828e699160d938f8dbe76e788133be08
child 45133 494cfdfda080e057d37d14097e7301e865b01ca0
push idunknown
push userunknown
push dateunknown
add a method to wrap a depth-only record (just depth and guid, nothing else)
services/sync/modules/stores.js
--- a/services/sync/modules/stores.js
+++ b/services/sync/modules/stores.js
@@ -125,16 +125,28 @@ Store.prototype = {
   wrap: function Store_wrap() {
     throw "override wrap in a subclass";
   },
 
   wrapItem: function Store_wrapItem() {
     throw "override wrapItem in a subclass";
   },
 
+  wrapDepth: function BStore_wrapDepth(guid, items) {
+    if (typeof(items) == "undefined")
+      items = {};
+    for (let childguid in this._itemCache) {
+      if (this._itemCache[childguid].parentid == guid) {
+        items[childguid] = this._itemCache[childguid].depth;
+        this.wrapDepth(childguid, items);
+      }
+    }
+    return items;
+  },
+
   changeItemID: function Store_changeItemID(oldID, newID) {
     throw "override changeItemID in a subclass";
   },
 
   getAllIDs: function Store_getAllIDs() {
     throw "override getAllIDs in a subclass";
   },