Closed Bug 396277 Opened 16 years ago Closed 16 years ago

'View Workweek days only' and 'View Tasks in View' don't work


(Calendar :: Calendar Frontend, defect)

Windows 2000
Not set


(Not tracked)



(Reporter: ssitter, Assigned: dbo)



(Keywords: regression)


(1 file)

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv: Gecko/20070914 Calendar/0.7pre

Steps to Reproduce:
1. Start Sunbird with clean profile
2. Create a task with start date and due date
3. Switch to Month View
4. Enable menu View -> Tasks in View
5. Enable menu View -> Workweek days only

Actual Results:
View doesn't change. Neither step 4. nor 5. work.

Regression Range:
WORKS in Sunbird 0.7pre (2007091306)
FAILS in Sunbird 0.7pre (2007091406)

Checkins during regression range:
Bug 393387 looks like the most likely causer
Flags: blocking-calendar0.7?
My guess: the patch in bug 393387 has a couple of checks like this:
+              if (!compareDatetimes(this.mStartDate, startDate) ||
+                  !compareDatetimes(this.mEndDate, endDate)) {
That means that the views will only get redrawn if the date range changed. But there are other reasons that it needs a redraw, like the change in pref this bug is about.
Good catch, thanks!
I need to investigate; may well be the case that some code relies on setRange/setDateList always updating the view.

@mvl: funny that this somehow relates to the discussion in bug 396223 ;)
Assignee: nobody → daniel.boelzle
Flags: blocking-calendar0.7? → blocking-calendar0.7+
Attached patch fixSplinter Review
This patch backs out my changes in setDateRange/setDateList which seemed to be a naive approach to avoid unnecessary view refreshes. Far too much code relies on goToDay() refreshing the view, although the date/range may not have been changed.
My primary motivation for that was a double refresh I experienced while debugging, caused by the unifinder todo list (its onLoad calls toDoUnifinderRefresh which refreshes the view, because "hide completed tasks" may have changed...). This patch changes the unifinder todo list to refresh only if "hide completed tasks" has changed.
Moreover I've optimized away double onLoad events caused by async providers w.r.t. composite. This patches changes composite the way that a single refresh will be answered by a single onLoad from only.

I'd appreciate further testing and feedback; this patch fixes the stated problems, although I couldn't reproduce the switching "workdays only" problem.
Attachment #281049 - Flags: review?(michael.buettner)
Comment on attachment 281049 [details] [diff] [review]

Please file a follow-up bug that thoroughly takes care of handling unnecessary view refreshes. The initial idea of optimizing away needless calls to getItems() was indeed valuable, but unfortunately it's not that easy. The patch itself look good, as it just backs out what has been recently introduced. r=mickey.
Attachment #281049 - Flags: review?(michael.buettner) → review+
(In reply to comment #4)
> (From update of attachment 281049 [details] [diff] [review])
> getItems() was indeed valuable, but unfortunately it's not that easy. The patch
> itself look good, as it just backs out what has been recently introduced.
Mickey, please mind that it not just backs out the setDateRange/setDateList part...
Blocks: 396279
Checked in on HEAD and MOZILLA_1_8_BRANCH.
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.7
Blocks: 396406
Verified using Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv: Gecko/20071002 Sunbird/0.7
You need to log in before you can comment on or make changes to this bug.