Bug 185870

Summary: Calculation of recurrent start dates is wrong
Product: [Applications] kdepimlibs Reporter: Thomas Förster <t.foerster>
Component: kcalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 4.2   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Thomas Förster 2009-03-01 13:13:54 UTC
Version:            (using KDE 4.2.0)
OS:                Linux
Installed from:    Gentoo Packages

Looking at the implementation of KCal::Todo::dtStart(bool) there seems to be a bug resulting in ignoring the bool flag.

00280 KDateTime Todo::dtStart( bool first ) const
00281 {
00282   if ( !hasStartDate() ) {
00283     return KDateTime();
00284   }
00285   if ( recurs() && !first ) {
00286     return d->mDtRecurrence.addDays( dtDue( first ).daysTo( IncidenceBase::dtStart() ) );
00287   } else {
00288     return IncidenceBase::dtStart();
00289   }
00290 }

If first is false, line 286 reduces to:

return d->mDtRecurrence.addDays( dtDue( false ).daysTo( dtStart( true ) ) );

d->mDtRecurrence and dtDue(false) are the same date (todo.cpp:171) so the whole function reduces to dtStart(true).

line 286 should be changed to ... addDays( dtDue(true).daysTo ...
Comment 1 Allen Winter 2009-03-02 00:12:44 UTC
SVN commit 933931 by winterz:

Fix calculation of recurring to-do start date/time, for other than the first occurrence.
thanks for the patch Thomas.

BUG: 185870


 M  +1 -1      todo.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=933931