summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/alarm.cpp36
-rw-r--r--libkcal/recurrence.cpp56
-rw-r--r--libkcal/sharpformat.cpp7
3 files changed, 83 insertions, 16 deletions
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp
index 29e6205..1fc7169 100644
--- a/libkcal/alarm.cpp
+++ b/libkcal/alarm.cpp
@@ -51,2 +51,3 @@ bool Alarm::operator==( const Alarm& rhs ) const
{
+
if ( mType != rhs.mType ||
@@ -58,2 +59,36 @@ bool Alarm::operator==( const Alarm& rhs ) const
+#if 0
+ if ( mType != rhs.mType ) {
+
+ qDebug("aaa1 ");
+ return false;
+ }
+
+ if ( mAlarmSnoozeTime != rhs.mAlarmSnoozeTime ) {
+
+ qDebug("aaa2 ");
+ return false;
+ }
+
+
+ if ( mAlarmRepeatCount != rhs.mAlarmRepeatCount ) {
+
+ qDebug("aaa3 ");
+ return false;
+ }
+
+ if ( mAlarmEnabled != rhs.mAlarmEnabled ) {
+
+ qDebug("aaa4 ");
+ return false;
+ }
+
+ if ( mHasTime != rhs.mHasTime ) {
+
+ qDebug("aaa5 ");
+ return false;
+ }
+#endif
+
+
if (mHasTime) {
@@ -66,3 +101,2 @@ bool Alarm::operator==( const Alarm& rhs ) const
}
-
switch (mType) {
diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp
index dd74e10..e84f672 100644
--- a/libkcal/recurrence.cpp
+++ b/libkcal/recurrence.cpp
@@ -108,2 +108,3 @@ bool Recurrence::operator==( const Recurrence& r2 ) const
// may be not initialized properly
+
if ( recurs != r2.recurs
@@ -124,14 +125,45 @@ bool Recurrence::operator==( const Recurrence& r2 ) const
&& 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:
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index defdb09..89eb72f 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -182,4 +182,5 @@ class SharpParser : public QObject
event->addAlarm( alarm );
+ alarm->setType( Alarm::Audio );
}
- alarm->setType( Alarm::Audio );
+ //alarm->setType( Alarm::Audio );
alarm->setEnabled( true );
@@ -370,3 +371,4 @@ ulong SharpFormat::getCsum( const QStringList & attList)
#include <stdlib.h>
-#define DEBUGMODE false
+//#define DEBUGMODE false
+#define DEBUGMODE true
bool SharpFormat::load( Calendar *calendar, Calendar *existngCal )
@@ -376,3 +378,2 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal )
bool debug = DEBUGMODE;
- //debug = true;
QString text;