Bug 1174397 - No current or upcoming Events in Today Pane. r+a=philipp
authorMatthew Mecca <matthew.mecca@gmail.com>
Mon, 29 Jun 2015 16:24:32 +0200
changeset 22818 7684af65861f1380661a10a408daa35dd4a5ab0b
parent 22817 0ca6d3c3d328149b7c254efcbe656d16a3174e0a
child 22819 99d02f70de9aff76228a13857aaf4020863c6974
push id1443
push usermbanner@mozilla.com
push dateMon, 10 Aug 2015 18:31:17 +0000
treeherdercomm-beta@8fe07d686c22 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1174397
Bug 1174397 - No current or upcoming Events in Today Pane. r+a=philipp
calendar/base/content/agenda-listbox.js
calendar/base/content/calendar-base-view.xml
--- a/calendar/base/content/agenda-listbox.js
+++ b/calendar/base/content/agenda-listbox.js
@@ -641,18 +641,19 @@ function refreshCalendarQuery(aStart, aE
             }
             for (let item of aItems) {
                 this.agendaListbox.addItem(item);
             }
         },
 
         cancel: function() {
             this.cancelled = true;
-            if (this.operation && this.operation.isPending) {
-                this.operation.cancel();
+            let op = cal.wrapInstance(this.operation, Components.interfaces.calIOperation);
+            if (op && op.isPending) {
+                op.cancel();
                 this.operation = null;
             }
         },
 
         execute: function(aStart, aEnd, aCalendar) {
             if (!(aStart || aEnd || aCalendar)) {
                 this.agendaListbox.removeListItems();
             }
@@ -685,16 +686,17 @@ function refreshCalendarQuery(aStart, aE
                     this.agendaListbox.mPendingRefreshJobs.delete(this.calId);
                 }
             }
             this.calendar = aCalendar;
 
             let filter = this.calendar.ITEM_FILTER_CLASS_OCCURRENCES |
                          this.calendar.ITEM_FILTER_TYPE_EVENT;
             let op = this.calendar.getItems(filter, 0, aStart, aEnd, this);
+            op = cal.wrapInstance(op, Components.interfaces.calIOperation);
             if (op && op.isPending) {
                 this.operation = op;
                 this.agendaListbox.mPendingRefreshJobs.set(this.calId, this);
             }
         }
     };
 
     refreshJob.execute(aStart, aEnd, aCalendar);
--- a/calendar/base/content/calendar-base-view.xml
+++ b/calendar/base/content/calendar-base-view.xml
@@ -481,18 +481,19 @@
                           this.calView.doAddItem(item);
                       }
                   }
               },
 
               cancel: function() {
                   this.calView.mLog.info("Refresh cancelled for calendar " + this.calId);
                   this.cancelled = true;
-                  if (this.operation && this.operation.isPending) {
-                      this.operation.cancel();
+                  let op = cal.wrapInstance(this.operation, Components.interfaces.calIOperation);
+                  if (op && op.isPending) {
+                      op.cancel();
                       this.operation = null;
                   }
               },
 
               execute: function(aCalendar) {
                   if (!this.calView.startDate || !this.calView.endDate || !aCalendar) {
                       return;
                   }
@@ -532,16 +533,17 @@
                       filter |= this.calendar.ITEM_FILTER_TYPE_EVENT;
                   }
 
                   let op = this.calendar.getItems(filter,
                                                   0,
                                                   this.calView.startDate,
                                                   this.calView.queryEndDate,
                                                   this);
+                  op = cal.wrapInstance(op, Components.interfaces.calIOperation);
                   if (op && op.isPending) {
                       this.operation = op;
                       this.calView.mPendingRefreshJobs.set(this.calId, this);
                   }
               }
           };
 
           refreshJob.execute(aCalendar);