summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koeditorrecurrence.cpp95
-rw-r--r--korganizer/koeditorrecurrence.h9
-rw-r--r--libkcal/icalformatimpl.cpp8
-rw-r--r--libkcal/recurrence.cpp17
-rw-r--r--libkcal/recurrence.h6
5 files changed, 89 insertions, 46 deletions
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp
index 98356fe..ffc0fac 100644
--- a/korganizer/koeditorrecurrence.cpp
+++ b/korganizer/koeditorrecurrence.cpp
@@ -301,22 +301,19 @@ RecurYearly::RecurYearly( QWidget *parent, const char *name ) :
301 301
302 302
303 QButtonGroup *buttonGroup = new QButtonGroup( this ); 303 QButtonGroup *buttonGroup = new QButtonGroup( this );
304 buttonGroup->setFrameStyle( QFrame::NoFrame ); 304 buttonGroup->setFrameStyle( QFrame::NoFrame );
305 topLayout->addWidget( buttonGroup, 1, AlignVCenter ); 305 topLayout->addWidget( buttonGroup, 1, AlignVCenter );
306 306
307 QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 3, 2 ); 307 QGridLayout *buttonLayout = new QGridLayout( buttonGroup, 2, 3 );
308 308
309 QString recurInMonthText; 309 mByMonthRadio = new QRadioButton( i18n("On day "), buttonGroup);
310 if ( !KOPrefs::instance()->mCompactDialogs ) { 310 buttonLayout->addWidget( mByMonthRadio, 0, 0 , Qt::AlignRight);
311 recurInMonthText = i18n("Recur in the month of"); 311 mByDayLabel = new QLabel( i18n(" 1 of "), buttonGroup );
312 }
313
314 mByMonthRadio = new QRadioButton( recurInMonthText, buttonGroup);
315 buttonLayout->addWidget( mByMonthRadio, 0, 0 );
316 312
313 buttonLayout->addWidget( mByDayLabel, 0, 1 );
317 mByMonthCombo = new QComboBox( buttonGroup ); 314 mByMonthCombo = new QComboBox( buttonGroup );
318 mByMonthCombo->insertItem( i18n("January") ); 315 mByMonthCombo->insertItem( i18n("January") );
319 mByMonthCombo->insertItem( i18n("February") ); 316 mByMonthCombo->insertItem( i18n("February") );
320 mByMonthCombo->insertItem( i18n("March") ); 317 mByMonthCombo->insertItem( i18n("March") );
321 mByMonthCombo->insertItem( i18n("April") ); 318 mByMonthCombo->insertItem( i18n("April") );
322 mByMonthCombo->insertItem( i18n("May") ); 319 mByMonthCombo->insertItem( i18n("May") );
@@ -324,38 +321,36 @@ RecurYearly::RecurYearly( QWidget *parent, const char *name ) :
324 mByMonthCombo->insertItem( i18n("July") ); 321 mByMonthCombo->insertItem( i18n("July") );
325 mByMonthCombo->insertItem( i18n("August") ); 322 mByMonthCombo->insertItem( i18n("August") );
326 mByMonthCombo->insertItem( i18n("September") ); 323 mByMonthCombo->insertItem( i18n("September") );
327 mByMonthCombo->insertItem( i18n("October") ); 324 mByMonthCombo->insertItem( i18n("October") );
328 mByMonthCombo->insertItem( i18n("November") ); 325 mByMonthCombo->insertItem( i18n("November") );
329 mByMonthCombo->insertItem( i18n("December") ); 326 mByMonthCombo->insertItem( i18n("December") );
330 buttonLayout->addWidget( mByMonthCombo, 0, 1 ); 327 buttonLayout->addWidget( mByMonthCombo, 0, 2,Qt::AlignLeft );
331 328 if ( QApplication::desktop()->width() <= 640 ) {
332 mByMonthCombo->setSizeLimit( 6 ); 329 mByMonthCombo->setSizeLimit( 6 );
333
334 buttonLayout->setRowStretch( 1, 1 );
335
336 QString recurOnDayText;
337 if ( KOPrefs::instance()->mCompactDialogs ) {
338 recurOnDayText = i18n("This day");
339 } else {
340 recurOnDayText = i18n("Recur on this day");
341 } 330 }
342 331
343 mByDayRadio = new QRadioButton( recurOnDayText, buttonGroup); 332 mByDayRadio = new QRadioButton( i18n("On day "), buttonGroup);
344 buttonLayout->addMultiCellWidget( mByDayRadio, 2, 2, 0, 1 ); 333 buttonLayout->addWidget( mByDayRadio, 1, 0 , Qt::AlignRight);
334 mDayOfLabel = new QLabel( i18n("1 of the year"), buttonGroup );
335 buttonLayout->addMultiCellWidget( mDayOfLabel, 1, 1, 1,3 );
336
345} 337}
346 338
347void RecurYearly::setByDay() 339void RecurYearly::setByDay( int doy )
348{ 340{
349 mByDayRadio->setChecked( true ); 341 mByDayRadio->setChecked( true );
342 mDayOfLabel->setText(i18n("%1 of the year").arg( doy ) );
350} 343}
351 344
352void RecurYearly::setByMonth( int month ) 345void RecurYearly::setByMonth( int month, int day )
353{ 346{
354 mByMonthRadio->setChecked( true ); 347 mByMonthRadio->setChecked( true );
355 mByMonthCombo->setCurrentItem( month - 1 ); 348 mByMonthCombo->setCurrentItem( month - 1 );
349 mByDayLabel->setText(i18n("%1 of ").arg( day ) );
350 mDay = day;
356} 351}
357 352
358bool RecurYearly::byMonth() 353bool RecurYearly::byMonth()
359{ 354{
360 return mByMonthRadio->isChecked(); 355 return mByMonthRadio->isChecked();
361} 356}
@@ -366,12 +361,16 @@ bool RecurYearly::byDay()
366} 361}
367 362
368int RecurYearly::month() 363int RecurYearly::month()
369{ 364{
370 return mByMonthCombo->currentItem() + 1; 365 return mByMonthCombo->currentItem() + 1;
371} 366}
367int RecurYearly::day()
368{
369 return mDay;//mByDayCombo->currentItem() + 1;
370}
372 371
373//////////////////////////// ExceptionsWidget ////////////////////////// 372//////////////////////////// ExceptionsWidget //////////////////////////
374 373
375ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) : 374ExceptionsWidget::ExceptionsWidget( QWidget *parent, const char *name ) :
376 QWidget( parent, name ) 375 QWidget( parent, name )
377{ 376{
@@ -841,12 +840,13 @@ void KOEditorRecurrence::setEnabled( bool enabled )
841 840
842 mTimeGroupBox->setEnabled( enabled ); 841 mTimeGroupBox->setEnabled( enabled );
843 if ( mRecurrenceRangeWidget ) mRecurrenceRangeWidget->setEnabled( enabled ); 842 if ( mRecurrenceRangeWidget ) mRecurrenceRangeWidget->setEnabled( enabled );
844 if ( mRecurrenceRangeButton ) mRecurrenceRangeButton->setEnabled( enabled ); 843 if ( mRecurrenceRangeButton ) mRecurrenceRangeButton->setEnabled( enabled );
845 if ( mExceptionsWidget ) mExceptionsWidget->setEnabled( enabled ); 844 if ( mExceptionsWidget ) mExceptionsWidget->setEnabled( enabled );
846 if ( mExceptionsButton ) mExceptionsButton->setEnabled( enabled ); 845 if ( mExceptionsButton ) mExceptionsButton->setEnabled( enabled );
846 mRuleBox->setEnabled( enabled );
847} 847}
848 848
849void KOEditorRecurrence::showCurrentRule( int current ) 849void KOEditorRecurrence::showCurrentRule( int current )
850{ 850{
851 switch ( current ) { 851 switch ( current ) {
852 case Daily: 852 case Daily:
@@ -892,23 +892,25 @@ void KOEditorRecurrence::setDefaults( QDateTime from, QDateTime to, bool )
892 892
893 mDaily->setFrequency( 1 ); 893 mDaily->setFrequency( 1 );
894 894
895 mWeekly->setFrequency( 1 ); 895 mWeekly->setFrequency( 1 );
896 QBitArray days( 7 ); 896 QBitArray days( 7 );
897 days.fill( 0 ); 897 days.fill( 0 );
898 days.setBit( from.date().dayOfWeek()- 1);
898 mWeekly->setDays( days ); 899 mWeekly->setDays( days );
899
900 mMonthly->setFrequency( 1 ); 900 mMonthly->setFrequency( 1 );
901 mMonthly->setByPos((from.date().day()/7), from.date().dayOfWeek()-1 );
901 mMonthly->setByDay( from.date().day()-1 ); 902 mMonthly->setByDay( from.date().day()-1 );
902
903 mYearly->setFrequency( 1 ); 903 mYearly->setFrequency( 1 );
904 mYearly->setByDay(); 904 mYearly->setByDay( from.date().dayOfYear() );
905 mYearly->setByMonth( from.date().month(), from.date().day() );
905} 906}
906 907
907void KOEditorRecurrence::readEvent(Event *event) 908void KOEditorRecurrence::readEvent(Event *event)
908{ 909{
910 setDefaults( event->dtStart(), event->dtEnd(), true );
909 QBitArray rDays( 7 ); 911 QBitArray rDays( 7 );
910 QPtrList<Recurrence::rMonthPos> rmp; 912 QPtrList<Recurrence::rMonthPos> rmp;
911 QPtrList<int> rmd; 913 QPtrList<int> rmd;
912 int day = 0; 914 int day = 0;
913 int count = 0; 915 int count = 0;
914 int month = 0; 916 int month = 0;
@@ -963,23 +965,41 @@ void KOEditorRecurrence::readEvent(Event *event)
963 mMonthly->setByDay( day ); 965 mMonthly->setByDay( day );
964 966
965 mMonthly->setFrequency( f ); 967 mMonthly->setFrequency( f );
966 968
967 break; 969 break;
968 case Recurrence::rYearlyMonth: 970 case Recurrence::rYearlyMonth:
969 case Recurrence::rYearlyDay: 971 {
970 recurrenceType = RecurrenceChooser::Yearly; 972 recurrenceType = RecurrenceChooser::Yearly;
971 973 qDebug("Recurrence::rYearlyMonth: ");
974 day = event->dtStart().date().day();
972 rmd = r->yearNums(); 975 rmd = r->yearNums();
976 if ( rmd.count() > 0 )
973 month = *rmd.first(); 977 month = *rmd.first();
974 if ( month == event->dtStart().date().month() ) { 978 else
975 mYearly->setByDay(); 979 month = event->dtStart().date().month() ;
980 mYearly->setByMonth( month, day );
981#if 0
982 qDebug("2day = %d ",day );
983 QPtrList<Recurrence::rMonthPos> monthlist = r->yearMonthPositions();
984 int month;
985 if ( !monthlist.isEmpty() ) {
986 month = monthlist.first()->rPos ;
976 } else { 987 } else {
977 mYearly->setByMonth( month ); 988 month = event->dtStart().date().month() ;
989 }
990 mYearly->setByMonth( day, month );
991#endif
992 mYearly->setFrequency( f );
978 } 993 }
979 994
995 break;
996 case Recurrence::rYearlyDay:
997 qDebug("Recurrence::rYearlyDay: ");
998 recurrenceType = RecurrenceChooser::Yearly;
999 mYearly->setByDay( event->dtStart().date().dayOfYear() );
980 mYearly->setFrequency( f ); 1000 mYearly->setFrequency( f );
981 break; 1001 break;
982 default: 1002 default:
983 setDefaults( event->dtStart(), event->dtEnd(), true ); 1003 setDefaults( event->dtStart(), event->dtEnd(), true );
984 break; 1004 break;
985 } 1005 }
@@ -1059,27 +1079,30 @@ void KOEditorRecurrence::writeEvent( Event *event )
1059 } else { 1079 } else {
1060 r->setMonthly( Recurrence::rMonthlyDay, freq, endDate ); 1080 r->setMonthly( Recurrence::rMonthlyDay, freq, endDate );
1061 } 1081 }
1062 r->addMonthlyDay( day ); 1082 r->addMonthlyDay( day );
1063 } 1083 }
1064 } else if ( recurrenceType == RecurrenceChooser::Yearly ) { 1084 } else if ( recurrenceType == RecurrenceChooser::Yearly ) {
1085 qDebug("RecurrenceChooser::Yearly ");
1065 int freq = mYearly->frequency(); 1086 int freq = mYearly->frequency();
1066 1087 if ( mYearly->byDay() ) {
1067 int month; 1088 if ( duration != 0 ) {
1068 if ( mYearly->byMonth() ) { 1089 r->setYearly( Recurrence::rYearlyDay, freq, duration );
1069 month = mYearly->month();
1070 } else { 1090 } else {
1071 month = event->dtStart().date().month(); 1091 r->setYearly( Recurrence::rYearlyDay, freq, endDate );
1072 } 1092 }
1093 r->addYearlyNum( event->dtStart().date().dayOfYear() );
1094 } else {
1073 if ( duration != 0 ) { 1095 if ( duration != 0 ) {
1074 r->setYearly( Recurrence::rYearlyMonth, freq, duration ); 1096 r->setYearly( Recurrence::rYearlyMonth, freq, duration );
1075 } else { 1097 } else {
1076 r->setYearly( Recurrence::rYearlyMonth, freq, endDate ); 1098 r->setYearly( Recurrence::rYearlyMonth, freq, endDate );
1077 } 1099 }
1100 r->addYearlyNum( mYearly->month() );
1101 }
1078 1102
1079 r->addYearlyNum( month );
1080 } 1103 }
1081 1104
1082 event->setExDates( mExceptions->dates() ); 1105 event->setExDates( mExceptions->dates() );
1083 } 1106 }
1084} 1107}
1085 1108
diff --git a/korganizer/koeditorrecurrence.h b/korganizer/koeditorrecurrence.h
index 4f0f0b2..2b59085 100644
--- a/korganizer/koeditorrecurrence.h
+++ b/korganizer/koeditorrecurrence.h
@@ -106,24 +106,27 @@ class RecurMonthly : public RecurBase
106 106
107class RecurYearly : public RecurBase 107class RecurYearly : public RecurBase
108{ 108{
109 public: 109 public:
110 RecurYearly( QWidget *parent = 0, const char *name = 0 ); 110 RecurYearly( QWidget *parent = 0, const char *name = 0 );
111 111
112 void setByDay(); 112 void setByDay( int doy );
113 void setByMonth( int month ); 113 void setByMonth( int month, int day );
114 114
115 bool byMonth(); 115 bool byMonth();
116 bool byDay(); 116 bool byDay();
117 117
118 int month(); 118 int month();
119 int day();
119 120
120 private: 121 private:
122 int mDay;
121 QRadioButton *mByMonthRadio; 123 QRadioButton *mByMonthRadio;
122 QComboBox *mByMonthCombo; 124 QComboBox *mByMonthCombo;
123 125 QLabel* mByDayLabel;
126 QLabel* mDayOfLabel;
124 QRadioButton *mByDayRadio; 127 QRadioButton *mByDayRadio;
125}; 128};
126 129
127class RecurrenceChooser : public QWidget 130class RecurrenceChooser : public QWidget
128{ 131{
129 Q_OBJECT 132 Q_OBJECT
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index 32a1337..964ffe3 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -1389,13 +1389,13 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre
1389 interv = 12; 1389 interv = 12;
1390 } 1390 }
1391 } 1391 }
1392 if ( r.freq == ICAL_YEARLY_RECURRENCE ) { 1392 if ( r.freq == ICAL_YEARLY_RECURRENCE ) {
1393 if ( r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX && r.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX ) { 1393 if ( r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX && r.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX ) {
1394 frequ = ICAL_MONTHLY_RECURRENCE; 1394 frequ = ICAL_MONTHLY_RECURRENCE;
1395 interv = 12; 1395 interv = 12* r.interval;
1396 } 1396 }
1397 } 1397 }
1398 1398
1399 switch (frequ) { 1399 switch (frequ) {
1400 case ICAL_MINUTELY_RECURRENCE: 1400 case ICAL_MINUTELY_RECURRENCE:
1401 if (!icaltime_is_null_time(r.until)) { 1401 if (!icaltime_is_null_time(r.until)) {
@@ -1496,12 +1496,13 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre
1496 recur->addMonthlyDay(day); 1496 recur->addMonthlyDay(day);
1497 } 1497 }
1498 } 1498 }
1499 break; 1499 break;
1500 case ICAL_YEARLY_RECURRENCE: 1500 case ICAL_YEARLY_RECURRENCE:
1501 if (r.by_year_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { 1501 if (r.by_year_day[0] != ICAL_RECURRENCE_ARRAY_MAX) {
1502 qDebug(" YEARLY DAY OF YEAR");
1502 if (!icaltime_is_null_time(r.until)) { 1503 if (!icaltime_is_null_time(r.until)) {
1503 recur->setYearly(Recurrence::rYearlyDay,interv, 1504 recur->setYearly(Recurrence::rYearlyDay,interv,
1504 readICalDate(r.until)); 1505 readICalDate(r.until));
1505 } else { 1506 } else {
1506 if (r.count == 0) 1507 if (r.count == 0)
1507 recur->setYearly(Recurrence::rYearlyDay,interv,-1); 1508 recur->setYearly(Recurrence::rYearlyDay,interv,-1);
@@ -1510,12 +1511,13 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre
1510 } 1511 }
1511 while((day = r.by_year_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { 1512 while((day = r.by_year_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
1512 recur->addYearlyNum(day); 1513 recur->addYearlyNum(day);
1513 } 1514 }
1514 } else if ( true /*r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX*/) { 1515 } else if ( true /*r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX*/) {
1515 if (r.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { 1516 if (r.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX) {
1517 qDebug("YEARLY POS NOT SUPPORTED BY GUI");
1516 if (!icaltime_is_null_time(r.until)) { 1518 if (!icaltime_is_null_time(r.until)) {
1517 recur->setYearly(Recurrence::rYearlyPos,interv, 1519 recur->setYearly(Recurrence::rYearlyPos,interv,
1518 readICalDate(r.until)); 1520 readICalDate(r.until));
1519 } else { 1521 } else {
1520 if (r.count == 0) 1522 if (r.count == 0)
1521 recur->setYearly(Recurrence::rYearlyPos,interv,-1); 1523 recur->setYearly(Recurrence::rYearlyPos,interv,-1);
@@ -1540,31 +1542,33 @@ void ICalFormatImpl::readRecurrence( const struct icalrecurrencetype &r, Recurre
1540 if (useSetPos) { 1542 if (useSetPos) {
1541 if (r.by_set_pos[0] != ICAL_RECURRENCE_ARRAY_MAX) { 1543 if (r.by_set_pos[0] != ICAL_RECURRENCE_ARRAY_MAX) {
1542 recur->addYearlyMonthPos(r.by_set_pos[0],qba); 1544 recur->addYearlyMonthPos(r.by_set_pos[0],qba);
1543 } 1545 }
1544 } 1546 }
1545 } else { 1547 } else {
1548 qDebug("YEARLY MONTH ");
1546 if (!icaltime_is_null_time(r.until)) { 1549 if (!icaltime_is_null_time(r.until)) {
1547 recur->setYearly(Recurrence::rYearlyMonth,interv, 1550 recur->setYearly(Recurrence::rYearlyMonth,interv,
1548 readICalDate(r.until)); 1551 readICalDate(r.until));
1549 } else { 1552 } else {
1550 if (r.count == 0) 1553 if (r.count == 0)
1551 recur->setYearly(Recurrence::rYearlyMonth,interv,-1); 1554 recur->setYearly(Recurrence::rYearlyMonth,interv,-1);
1552 else 1555 else
1553 recur->setYearly(Recurrence::rYearlyMonth,interv,r.count); 1556 recur->setYearly(Recurrence::rYearlyMonth,interv,r.count);
1554 } 1557 }
1555 }
1556 if ( r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX ) { 1558 if ( r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX ) {
1557 index = 0; 1559 index = 0;
1558 while((day = r.by_month[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { 1560 while((day = r.by_month[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
1559 recur->addYearlyNum(day); 1561 recur->addYearlyNum(day);
1560 } 1562 }
1561 } else { 1563 } else {
1562 recur->addYearlyNum(incidence->dtStart().date().month()); 1564 recur->addYearlyNum(incidence->dtStart().date().month());
1563 } 1565 }
1564 } 1566 }
1567
1568 }
1565 break; 1569 break;
1566 default: 1570 default:
1567 ; 1571 ;
1568 break; 1572 break;
1569 } 1573 }
1570} 1574}
diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp
index 5fc5d1f..dd74e10 100644
--- a/libkcal/recurrence.cpp
+++ b/libkcal/recurrence.cpp
@@ -651,13 +651,13 @@ void Recurrence::addMonthlyPos_(short _rPos, const QBitArray &_rDays)
651 651
652 if (mParent) mParent->updated(); 652 if (mParent) mParent->updated();
653} 653}
654 654
655void Recurrence::addMonthlyDay(short _rDay) 655void Recurrence::addMonthlyDay(short _rDay)
656{ 656{
657 if (mRecurReadOnly || recurs != rMonthlyDay 657 if (mRecurReadOnly || (recurs != rMonthlyDay && recurs != rYearlyMonth)
658 || _rDay == 0 || _rDay > 31 || _rDay < -31) // invalid day number 658 || _rDay == 0 || _rDay > 31 || _rDay < -31) // invalid day number
659 return; 659 return;
660 for (int* it = rMonthDays.first(); it; it = rMonthDays.next()) { 660 for (int* it = rMonthDays.first(); it; it = rMonthDays.next()) {
661 if (_rDay == *it) 661 if (_rDay == *it)
662 return; // this day is already in the list - avoid duplication 662 return; // this day is already in the list - avoid duplication
663 } 663 }
@@ -722,13 +722,26 @@ void Recurrence::addYearlyMonthPos(short _rPos, const QBitArray &_rDays)
722} 722}
723 723
724const QPtrList<int> &Recurrence::yearNums() const 724const QPtrList<int> &Recurrence::yearNums() const
725{ 725{
726 return rYearNums; 726 return rYearNums;
727} 727}
728 728void Recurrence::addYearlyMonth(short _rPos )
729{
730 if (mRecurReadOnly || recurs != rYearlyMonth) // invalid day/month number
731 return;
732 rMonthPos *tmpPos = new rMonthPos;
733 if ( _rPos > 0) {
734 tmpPos->rPos = _rPos;
735 tmpPos->negative = false;
736 } else {
737 tmpPos->rPos = -_rPos; // take abs()
738 tmpPos->negative = true;
739 }
740 rMonthPositions.append(tmpPos);
741}
729void Recurrence::addYearlyNum(short _rNum) 742void Recurrence::addYearlyNum(short _rNum)
730{ 743{
731 if (mRecurReadOnly 744 if (mRecurReadOnly
732 || (recurs != rYearlyMonth && recurs != rYearlyDay && recurs != rYearlyPos) 745 || (recurs != rYearlyMonth && recurs != rYearlyDay && recurs != rYearlyPos)
733 || _rNum <= 0) // invalid day/month number 746 || _rNum <= 0) // invalid day/month number
734 return; 747 return;
diff --git a/libkcal/recurrence.h b/libkcal/recurrence.h
index a0f6d84..b13d14f 100644
--- a/libkcal/recurrence.h
+++ b/libkcal/recurrence.h
@@ -285,18 +285,20 @@ class Recurrence
285 /** Returns how yearly recurrences of February 29th are handled. */ 285 /** Returns how yearly recurrences of February 29th are handled. */
286 Feb29Type feb29YearlyType() const { return mFeb29YearlyType; } 286 Feb29Type feb29YearlyType() const { return mFeb29YearlyType; }
287 /** Sets the default method for handling yearly recurrences of February 29th. */ 287 /** Sets the default method for handling yearly recurrences of February 29th. */
288 static void setFeb29YearlyTypeDefault(Feb29Type t) { mFeb29YearlyDefaultType = t; } 288 static void setFeb29YearlyTypeDefault(Feb29Type t) { mFeb29YearlyDefaultType = t; }
289 /** Returns the default method for handling yearly recurrences of February 29th. */ 289 /** Returns the default method for handling yearly recurrences of February 29th. */
290 static Feb29Type setFeb29YearlyTypeDefault() { return mFeb29YearlyDefaultType; } 290 static Feb29Type setFeb29YearlyTypeDefault() { return mFeb29YearlyDefaultType; }
291 291 void addYearlyMonth(short _rPos ); // added LR
292 /** 292 /**
293 Debug output. 293 Debug output.
294 */ 294 */
295 void dump() const; 295 void dump() const;
296 QString recurrenceText() const; 296 QString recurrenceText() const;
297 bool getYearlyMonthMonths(int day, QValueList<int>&,
298 QValueList<int> &leaplist) const;
297 299
298 protected: 300 protected:
299 enum PeriodFunc { END_DATE_AND_COUNT, COUNT_TO_DATE, NEXT_AFTER_DATE }; 301 enum PeriodFunc { END_DATE_AND_COUNT, COUNT_TO_DATE, NEXT_AFTER_DATE };
300 struct MonthlyData; friend struct MonthlyData; 302 struct MonthlyData; friend struct MonthlyData;
301 struct YearlyMonthData; friend struct YearlyMonthData; 303 struct YearlyMonthData; friend struct YearlyMonthData;
302 struct YearlyPosData; friend struct YearlyPosData; 304 struct YearlyPosData; friend struct YearlyPosData;
@@ -343,14 +345,12 @@ class Recurrence
343 int yearlyDayCalcNextAfter(QDate& enddate, YearlyDayData&) const; 345 int yearlyDayCalcNextAfter(QDate& enddate, YearlyDayData&) const;
344 346
345 int countMonthlyPosDays() const; 347 int countMonthlyPosDays() const;
346 void getMonthlyPosDays(QValueList<int>&, int daysInMonth, 348 void getMonthlyPosDays(QValueList<int>&, int daysInMonth,
347 int startDayOfWeek) const; 349 int startDayOfWeek) const;
348 bool getMonthlyDayDays(QValueList<int>&, int daysInMonth) const; 350 bool getMonthlyDayDays(QValueList<int>&, int daysInMonth) const;
349 bool getYearlyMonthMonths(int day, QValueList<int>&,
350 QValueList<int> &leaplist) const;
351 351
352 int getFirstDayInWeek(int startDay, bool useWeekStart = true) const; 352 int getFirstDayInWeek(int startDay, bool useWeekStart = true) const;
353 int getLastDayInWeek(int endDay, bool useWeekStart = true) const; 353 int getLastDayInWeek(int endDay, bool useWeekStart = true) const;
354 QDate getFirstDateInMonth(const QDate& earliestDate) const; 354 QDate getFirstDateInMonth(const QDate& earliestDate) const;
355 QDate getLastDateInMonth(const QDate& latestDate) const; 355 QDate getLastDateInMonth(const QDate& latestDate) const;
356 QDate getFirstDateInYear(const QDate& earliestDate) const; 356 QDate getFirstDateInYear(const QDate& earliestDate) const;