[Kde-pim] Review Request 114407: OccurrenceIterator: ensure that incidences with recurrences ID and a base incidence outside start/end range are included in iterator

Christian Mollekopf chrigi_1 at fastmail.fm
Fri Dec 13 09:26:57 GMT 2013



> On Dec. 11, 2013, 6:47 p.m., Christian Mollekopf wrote:
> > kcalcore/occurrenceiterator.cpp, line 180
> > <http://git.reviewboard.kde.org/r/114407/diff/1/?file=224446#file224446line180>
> >
> >     Isn't base incidence part of incidences anyways, so you're collecting the occurrences twice? In other words, why is this section necessary?
> 
> Justus Matthiesen wrote:
>     Unfortunately not. If inc is in range but baseIncidence isn't, then rawEvents will not include baseIncidence.
>     
>     My test "testIterationWithMeanException" (now more descriptively called "testIterationWithExceptionMovedInsideRange") is a good demonstration.

Ok, makes sense. Please refactor to make it more obvious what's happening:

if ( inc->hasRecurrenceId() ) {
  if ( !baseInicidenceIsNotInSet(inc) ) {
    //base incidence is outside of the range, so get it from the calendar instead
    Incidence::Ptr baseIncidence = calendar.incidence( inc->uid() );
    ....

or something something similar that makes it obvious what's happening.


- Christian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/114407/#review45554
-----------------------------------------------------------


On Dec. 11, 2013, 3:45 p.m., Justus Matthiesen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/114407/
> -----------------------------------------------------------
> 
> (Updated Dec. 11, 2013, 3:45 p.m.)
> 
> 
> Review request for KDEPIM and KDEPIM-Libraries.
> 
> 
> Bugs: 328585
>     http://bugs.kde.org/show_bug.cgi?id=328585
> 
> 
> Repository: kdepimlibs
> 
> 
> Description
> -------
> 
> Summary
> --------
> 
> offset-related changes
> (1.1) cancelled (recurring) events contribute to offsets
> (1.2) can now have a non-zero initial offset due to an exception just before start of range
> 
> range-related special cases
> (2.1) skipping over exceptions whose original start date was in specified start/end range but new one is no longer
> (2.1) including exception whose original start date was out of range but new one is inside
> 
> This diff was originally a series of 10 commits; see branch KDE/4.11 in repository git://gitorious.org/kdepimlibs/kdepimlibs.git for details (or https://gitorious.org/kdepimlibs/kdepimlibs ).
> 
> 
> Diffs
> -----
> 
>   kcalcore/occurrenceiterator.h 5927ad587922af9fd25d6a04af8bc298d37554ab 
>   kcalcore/occurrenceiterator.cpp d3bccf5ed829602f84011c2ada892c6266ff01ba 
>   kcalcore/tests/testoccurrenceiterator.h e79e5cdb8a0947380b818d45484f6eeb1a136026 
>   kcalcore/tests/testoccurrenceiterator.cpp d07ccd939e437c7047bf22dab986300bf20824ad 
> 
> Diff: http://git.reviewboard.kde.org/r/114407/diff/
> 
> 
> Testing
> -------
> 
> All unit test pass; my own calendar file seems to functions without any issues; and test case [1] attached to bug report #328589 now renders correctly.
> 
> [1] http://bugsfiles.kde.org/attachment.cgi?id=84005
> 
> 
> Thanks,
> 
> Justus Matthiesen
> 
>

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list