summaryrefslogtreecommitdiffabout
path: root/libkcal
authorzautrix <zautrix>2005-01-31 16:29:05 (UTC)
committer zautrix <zautrix>2005-01-31 16:29:05 (UTC)
commitec037c4616342c1b3976c55db98b775f48e0d455 (patch) (unidiff)
tree9d568c8f6ad6005f822c12644596b7a553837c7f /libkcal
parent5d52c81be9b43887c13f8534a04164d3b44b821f (diff)
downloadkdepimpi-ec037c4616342c1b3976c55db98b775f48e0d455.zip
kdepimpi-ec037c4616342c1b3976c55db98b775f48e0d455.tar.gz
kdepimpi-ec037c4616342c1b3976c55db98b775f48e0d455.tar.bz2
fix
Diffstat (limited to 'libkcal') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp1
-rw-r--r--libkcal/incidence.cpp3
2 files changed, 2 insertions, 2 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 0eba6a9..e75154b 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -578,24 +578,25 @@ QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted )
578 i++; 578 i++;
579 sortEvent = eventListSorted.next(); 579 sortEvent = eventListSorted.next();
580 } 580 }
581 eventListSorted.insert( i, event ); 581 eventListSorted.insert( i, event );
582 } 582 }
583 return eventListSorted; 583 return eventListSorted;
584} 584}
585 585
586 586
587QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, 587QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end,
588 bool inclusive ) 588 bool inclusive )
589{ 589{
590 qDebug("CalendarLocal::rawEvents called ");
590 Event *event = 0; 591 Event *event = 0;
591 592
592 QPtrList<Event> eventList; 593 QPtrList<Event> eventList;
593 594
594 // Get non-recurring events 595 // Get non-recurring events
595 for( event = mEventList.first(); event; event = mEventList.next() ) { 596 for( event = mEventList.first(); event; event = mEventList.next() ) {
596 if ( event->doesRecur() ) { 597 if ( event->doesRecur() ) {
597 QDate rStart = event->dtStart().date(); 598 QDate rStart = event->dtStart().date();
598 bool found = false; 599 bool found = false;
599 if ( inclusive ) { 600 if ( inclusive ) {
600 if ( rStart >= start && rStart <= end ) { 601 if ( rStart >= start && rStart <= end ) {
601 // Start date of event is in range. Now check for end date. 602 // Start date of event is in range. Now check for end date.
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 28402ae..f9e1e9e 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -583,35 +583,34 @@ QDateTime Incidence::getNextOccurence( const QDateTime& dt, bool* ok ) const
583 if ( !last ) { 583 if ( !last ) {
584 while ( !last ) { 584 while ( !last ) {
585 ++count; 585 ++count;
586 incidenceStart = recurrence()->getNextDateTime( incidenceStart, &last ); 586 incidenceStart = recurrence()->getNextDateTime( incidenceStart, &last );
587 if ( recursOn( incidenceStart.date() ) ) { 587 if ( recursOn( incidenceStart.date() ) ) {
588 last = true; // exit while llop 588 last = true; // exit while llop
589 } else { 589 } else {
590 if ( last ) { // no alarm on last recurrence 590 if ( last ) { // no alarm on last recurrence
591 return QDateTime (); 591 return QDateTime ();
592 } 592 }
593 int year = incidenceStart.date().year(); 593 int year = incidenceStart.date().year();
594 // workaround for bug in recurrence 594 // workaround for bug in recurrence
595 if ( count == 100 || year < 1980 || year > 5000 ) { 595 if ( count == 100 || year < 1000 || year > 5000 ) {
596 return QDateTime (); 596 return QDateTime ();
597 } 597 }
598 incidenceStart = incidenceStart.addSecs( 1 ); 598 incidenceStart = incidenceStart.addSecs( 1 );
599 } 599 }
600 } 600 }
601 } else { 601 } else {
602 return QDateTime (); 602 return QDateTime ();
603 } 603 }
604 } else { 604 } else {
605 if ( hasStartDate () ) { 605 if ( hasStartDate () ) {
606 incidenceStart = dtStart(); 606 incidenceStart = dtStart();
607 } 607 }
608 if ( type() =="Todo" ) { 608 if ( type() =="Todo" ) {
609 if ( ((Todo*)this)->hasDueDate() ) 609 if ( ((Todo*)this)->hasDueDate() )
610 incidenceStart = ((Todo*)this)->dtDue(); 610 incidenceStart = ((Todo*)this)->dtDue();
611
612 } 611 }
613 } 612 }
614 if ( incidenceStart > dt ) 613 if ( incidenceStart > dt )
615 *ok = true; 614 *ok = true;
616 return incidenceStart; 615 return incidenceStart;
617} 616}