fix bookmarks tracker by removing yield calls (which of course don't work as callbacks for nsIBookmarksObserver)
authorDan Mills <thunder@mozilla.com>
Tue, 02 Dec 2008 16:46:24 -0800
changeset 45075 d3f6e2cf4fc7b4bc1458175208ecdcde46571caa
parent 45074 e14daee67de057d552e0a51d79713b770c45c168
child 45076 66d3bdc803f093968127327655de29389d5bd69c
push idunknown
push userunknown
push dateunknown
fix bookmarks tracker by removing yield calls (which of course don't work as callbacks for nsIBookmarksObserver)
services/sync/modules/engines/bookmarks.js
--- a/services/sync/modules/engines/bookmarks.js
+++ b/services/sync/modules/engines/bookmarks.js
@@ -1433,44 +1433,35 @@ BookmarksTracker.prototype = {
       getService(Ci.nsINavBookmarksService).
       addObserver(this, false);
   },
 
   // FIXME: not getting any events whatsoever!
 
   /* Every add/remove/change is worth 10 points */
 
-  onItemAdded: function BMT_onEndUpdateBatch(itemId) {
-    this._log.debug("Adding item to queue: " + itemId);
+  onItemAdded: function BMT_onEndUpdateBatch(itemId, folder, index) {
+    this._log.debug("Item " + itemId + " added, adding to queue");
     this._score += 10;
-    let all = this._engine._store.wrap();
-    let record = yield this._engine._createRecord.async(this, self.cb, key, all[itemId]);
-    this._engine.outgoing.push(record);
+    //let all = this._engine._store.wrap();
+    //let record = yield this._engine._createRecord.async(this, self.cb, key, all[itemId]);
+    //this._engine.outgoing.push(record);
   },
 
-  onItemRemoved: function BMT_onItemRemoved(itemId) {
-    this._log.debug("Adding item to queue: " + itemId);
+  onItemRemoved: function BMT_onItemRemoved(itemId, folder, index) {
+    this._log.debug("Item " + itemId + " removed, adding to queue");
     this._score += 10;
-    let all = this._engine._store.wrap();
-    let record = yield this._engine._createRecord.async(this, self.cb, key, all[itemId]);
-    this._engine.outgoing.push(record);
   },
 
-  onItemChanged: function BMT_onItemChanged(itemId) {
-    this._log.debug("Adding item to queue: " + itemId);
+  onItemChanged: function BMT_onItemChanged(itemId, property, isAnnotationProperty, value) {
+    this._log.debug("Item " + itemId + " changed, adding to queue");
     this._score += 10;
-    let all = this._engine._store.wrap();
-    let record = yield this._engine._createRecord.async(this, self.cb, key, all[itemId]);
-    this._engine.outgoing.push(record);
   },
 
-  onItemMoved: function BMT_onItemMoved(itemId) {
-    this._log.debug("Adding item to queue: " + itemId);
+  onItemMoved: function BMT_onItemMoved(itemId, oldParent, oldIndex, newParent, newIndex) {
+    this._log.debug("Item " + itemId + " moved, adding to queue");
     this._score += 10;
-    let all = this._engine._store.wrap();
-    let record = yield this._engine._createRecord.async(this, self.cb, key, all[itemId]);
-    this._engine.outgoing.push(record);
   },
 
   onBeginUpdateBatch: function BMT_onBeginUpdateBatch() {},
   onEndUpdateBatch: function BMT_onEndUpdateBatch() {},
-  onItemVisited: function BMT_onItemVisited() {}
+  onItemVisited: function BMT_onItemVisited(itemId, aVisitID, time) {}
 };