Closed Bug 314345 Opened 14 years ago Closed 14 years ago

Events and tasks still seen if all calendars is deselected

Categories

(Calendar :: Sunbird Only, defect)

x86
All
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: robin.edrenius, Assigned: jminta)

Details

Attachments

(1 file, 1 obsolete file)

If you deselect all calendars you will still see the events in the event-list and the tasks in the tasks list. You will not see them in the calendar though.

If there are more than one calendar, the events and tasks of the calendar that is deselected last is still shown.
Attached patch handle no calendar case (obsolete) — Splinter Review
If there are no calendars, cmpListener never gets a chance to call onOperationComplete, because it never executes a getItems call itself.  Therefore, in this case, we just call onOperationComplete directly.

This is a fairly noticable regression from 0.2.  Not sure if it's bad enough to warrant a last-minute checkin like this though.
Assignee: mostafah → jminta
Status: NEW → ASSIGNED
Attachment #201283 - Flags: first-review?(mvl)
Comment on attachment 201283 [details] [diff] [review]
handle no calendar case

>     getItems: function (aItemFilter, aCount, aRangeStart, aRangeEnd, aListener) {
>+        // If there are no calendars, then we just call onOperationComplete
>+        if (this.mCalendars.length == 0) {
>+            aListener.onOperationComplete (this,
>+                                           1,
>+                                           calIOperationListener.GET,
>+                                           null,
>+                                           null);

the '1' is pretty magic. Shouldn't it be an nsresult (NS_OK or something)?
Comment on attachment 201283 [details] [diff] [review]
handle no calendar case

see comment 2
Attachment #201283 - Flags: first-review?(mvl) → first-review-
Same as before, but without the magic 1.
Attachment #201283 - Attachment is obsolete: true
Attachment #202092 - Flags: first-review?(mvl)
Comment on attachment 202092 [details] [diff] [review]
handle no calendar case v2

r=mvl
Attachment #202092 - Flags: first-review?(mvl) → first-review+
patch checked in
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.