Bug 185870 - Calculation of recurrent start dates is wrong
Summary: Calculation of recurrent start dates is wrong
Status: RESOLVED FIXED
Alias: None
Product: kdepimlibs
Classification: Applications
Component: kcal (show other bugs)
Version: 4.2
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-01 13:13 UTC by Thomas Förster
Modified: 2009-03-02 00:12 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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