summaryrefslogtreecommitdiffabout
path: root/libkcal/recurrence.cpp
authorzautrix <zautrix>2004-09-14 01:03:08 (UTC)
committer zautrix <zautrix>2004-09-14 01:03:08 (UTC)
commit30762fe125216362e1a6c1d5ec5d22d9525aa336 (patch) (side-by-side diff)
tree4ff0fbf43efa921c86d64ff3f50baa9e59d207d9 /libkcal/recurrence.cpp
parent8ce7eae438dcd20f9c79fc0a36dfef0a6d3931eb (diff)
downloadkdepimpi-30762fe125216362e1a6c1d5ec5d22d9525aa336.zip
kdepimpi-30762fe125216362e1a6c1d5ec5d22d9525aa336.tar.gz
kdepimpi-30762fe125216362e1a6c1d5ec5d22d9525aa336.tar.bz2
Many bugfixes
Diffstat (limited to 'libkcal/recurrence.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/recurrence.cpp56
1 files changed, 44 insertions, 12 deletions
diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp
index dd74e10..e84f672 100644
--- a/libkcal/recurrence.cpp
+++ b/libkcal/recurrence.cpp
@@ -106,6 +106,7 @@ bool Recurrence::operator==( const Recurrence& r2 ) const
// we need the above line, because two non recurring events may
// differ in the other settings, because one (or both)
// may be not initialized properly
+
if ( recurs != r2.recurs
|| rFreq != r2.rFreq
|| rDuration != r2.rDuration
@@ -122,18 +123,49 @@ bool Recurrence::operator==( const Recurrence& r2 ) const
case rWeekly:
return rDays == r2.rDays
&& rWeekStart == r2.rWeekStart;
- case rMonthlyPos:
- return rMonthPositions.count() == r2.rMonthPositions.count();
- case rMonthlyDay:
- return rMonthDays.count() == r2.rMonthDays.count();
- case rYearlyPos:
- return rYearNums.count() == r2.rYearNums.count()
- && rMonthPositions.count() == r2.rMonthPositions.count();
- case rYearlyMonth:
- return rYearNums.count() == r2.rYearNums.count()
- && mFeb29YearlyType == r2.mFeb29YearlyType;
- case rYearlyDay:
- return rYearNums == r2.rYearNums;
+ case rMonthlyPos: {
+ QPtrList<rMonthPos> MonthPositions = rMonthPositions;
+ QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions;
+ if ( !MonthPositions.count() )
+ return false;
+ if ( !MonthPositions2.count() )
+ return false;
+ return MonthPositions.first()->rPos == MonthPositions2.first()->rPos;
+ }
+ case rMonthlyDay: {
+ QPtrList<int> MonthDays = rMonthDays ;
+ QPtrList<int> MonthDays2 = r2.rMonthDays ;
+ if ( !MonthDays.count() )
+ return false;
+ if ( !MonthDays2.count() )
+ return false;
+ return *MonthDays.first() == *MonthDays2.first() ;
+ }
+ case rYearlyPos: {
+
+ QPtrList<int> YearNums = rYearNums;
+ QPtrList<int> YearNums2 = r2.rYearNums;
+ if ( *YearNums.first() != *YearNums2.first() )
+ return false;
+ QPtrList<rMonthPos> MonthPositions = rMonthPositions;
+ QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions;
+ if ( !MonthPositions.count() )
+ return false;
+ if ( !MonthPositions2.count() )
+ return false;
+ return MonthPositions.first()->rPos == MonthPositions2.first()->rPos;
+
+ }
+ case rYearlyMonth: {
+ QPtrList<int> YearNums = rYearNums;
+ QPtrList<int> YearNums2 = r2.rYearNums;
+ return ( *YearNums.first() == *YearNums2.first() && mFeb29YearlyType == r2.mFeb29YearlyType);
+ }
+ case rYearlyDay: {
+ QPtrList<int> YearNums = rYearNums;
+ QPtrList<int> YearNums2 = r2.rYearNums;
+ return ( *YearNums.first() == *YearNums2.first() );
+ }
case rNone:
case rMinutely:
case rHourly: