Fix bug 717081 - Get rid of extra onLoad during cached calendar sync. r=redDragon,a=philipp
authorPhilipp Kewisch <mozilla@kewis.ch>
Thu, 12 Jan 2012 21:13:43 +0100
changeset 9787 977925b81e003622bed18cc1c07da988520322fe
parent 9783 773ba927dc43fb8bddfc78f9b4ea243f72d61429
child 9788 cb9de3bd086658d4e28dec22a04dfd662181c3bb
push id311
push usermozilla@kewis.ch
push dateThu, 12 Jan 2012 20:17:53 +0000
treeherdercomm-beta@cb9de3bd0866 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersredDragon, philipp
bugs717081
Fix bug 717081 - Get rid of extra onLoad during cached calendar sync. r=redDragon,a=philipp
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() {