Fix bug 717081 - Get rid of extra onLoad during cached calendar sync. r=redDragon
authorPhilipp Kewisch <mozilla@kewis.ch>
Thu, 12 Jan 2012 21:13:43 +0100
changeset 9174 5b6cf9b3be522a23e4d9613275117e884428a33c
parent 9173 7ad0f0a36639cadc9c9e36ad5bf9e7575f92a7c1
child 9175 a6ca255de8ff46fe39599526c9c3ceba1bf19b40
push id7023
push usermozilla@kewis.ch
push dateThu, 12 Jan 2012 20:16:53 +0000
treeherdercomm-central@a6ca255de8ff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersredDragon
bugs717081
Fix bug 717081 - Get rid of extra onLoad during cached calendar sync. r=redDragon
calendar/base/src/calCachedCalendar.js
--- a/calendar/base/src/calCachedCalendar.js
+++ b/calendar/base/src/calCachedCalendar.js
@@ -400,18 +400,17 @@ calCachedCalendar.prototype = {
                                     // Item has already been deleted from the server, no need to change anything.
                                 }
                                 break;
                         }
                     }
                     this_.offlineCachedItems = {};
                     this_.offlineCachedItemFlags = {};
                 }
-                this_.playbackAddedItems(function() {this_.mCachedObserver.onLoad(this_.mCachedCalendar);});
-                emptyQueue(aStatus);
+                this_.playbackAddedItems(function() { emptyQueue(aStatus) });
             }
         };
 
         this.getOfflineAddedItems(function(){
             this_.mPendingSync = this_.mUncachedCalendar.getItems(Components.interfaces.calICalendar.ITEM_FILTER_ALL_ITEMS,
                                                                     0, null,  null, completeListener);
         });
         return this.mPendingSync;
@@ -657,20 +656,18 @@ calCachedCalendar.prototype = {
     },
 
     get canRefresh() { // enable triggering sync using the reload button
         return true;
     },
     refresh: function() {
         if (this.offline) {
             this.downstreamRefresh();
-        }
-        else {
+        } else {
             /* we first ensure that any remaining offline items are reconciled with the calendar server */
-            let this_ = this;
             if (this.supportsChangeLog) {
                 this.playbackAddedItems(this.downstreamRefresh.bind(this));
             } else {
                 this.downstreamRefresh();
             }
         }
     },
     downstreamRefresh: function() {