author | zautrix <zautrix> | 2004-09-14 01:03:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-14 01:03:08 (UTC) |
commit | 30762fe125216362e1a6c1d5ec5d22d9525aa336 (patch) (unidiff) | |
tree | 4ff0fbf43efa921c86d64ff3f50baa9e59d207d9 | |
parent | 8ce7eae438dcd20f9c79fc0a36dfef0a6d3931eb (diff) | |
download | kdepimpi-30762fe125216362e1a6c1d5ec5d22d9525aa336.zip kdepimpi-30762fe125216362e1a6c1d5ec5d22d9525aa336.tar.gz kdepimpi-30762fe125216362e1a6c1d5ec5d22d9525aa336.tar.bz2 |
Many bugfixes
-rw-r--r-- | korganizer/calendarview.cpp | 16 | ||||
-rw-r--r-- | libkcal/alarm.cpp | 36 | ||||
-rw-r--r-- | libkcal/recurrence.cpp | 56 | ||||
-rw-r--r-- | libkcal/sharpformat.cpp | 7 |
4 files changed, 94 insertions, 21 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 258bd43..94cc97d 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -739,5 +739,5 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b | |||
739 | } else { | 739 | } else { |
740 | if ( locCh ) { | 740 | if ( locCh ) { |
741 | qDebug("loc changed %d", local->revision() ); | 741 | qDebug("loc changed %d %s %s", local->revision() , local->lastModified().toString().latin1(), mLastCalendarSync.toString().latin1()); |
742 | lastSync = local->lastModified().addDays( -1 ); | 742 | lastSync = local->lastModified().addDays( -1 ); |
743 | if ( !remCh ) | 743 | if ( !remCh ) |
@@ -787,5 +787,5 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b | |||
787 | int result; | 787 | int result; |
788 | bool localIsNew; | 788 | bool localIsNew; |
789 | qDebug("mLastCalendarSync %s lastsync %s --- local %s remote %s ",mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , local->lastModified().toString().latin1() , remote->lastModified().toString().latin1() ); | 789 | //qDebug("%s -- %s mLastCalendarSync %s lastsync %s --- local %s remote %s ",local->summary().latin1(), remote->summary().latin1(),mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , local->lastModified().toString().latin1() , remote->lastModified().toString().latin1() ); |
790 | 790 | ||
791 | if ( full && mode < SYNC_PREF_NEWEST ) | 791 | if ( full && mode < SYNC_PREF_NEWEST ) |
@@ -1031,5 +1031,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1031 | if ( inL->revision() < maxrev ) | 1031 | if ( inL->revision() < maxrev ) |
1032 | inL->setRevision( maxrev ); | 1032 | inL->setRevision( maxrev ); |
1033 | remote->addIncidence( inL->clone() ); | 1033 | inR = inL->clone(); |
1034 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | ||
1035 | remote->addIncidence( inR ); | ||
1034 | ++changedRemote; | 1036 | ++changedRemote; |
1035 | } else { | 1037 | } else { |
@@ -1053,5 +1055,6 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1053 | } else { | 1055 | } else { |
1054 | inR->setLastModified( modifiedCalendar ); | 1056 | inR->setLastModified( modifiedCalendar ); |
1055 | local->addIncidence( inR->clone() ); | 1057 | inL = inR->clone(); |
1058 | local->addIncidence( inL ); | ||
1056 | ++addedEvent; | 1059 | ++addedEvent; |
1057 | } | 1060 | } |
@@ -1104,6 +1107,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1104 | inL->removeID(mCurrentSyncDevice ); | 1107 | inL->removeID(mCurrentSyncDevice ); |
1105 | ++addedEventR; | 1108 | ++addedEventR; |
1109 | qDebug("remote added Incidence %s ", inL->summary().latin1()); | ||
1106 | inL->setLastModified( modifiedCalendar ); | 1110 | inL->setLastModified( modifiedCalendar ); |
1107 | remote->addIncidence( inL->clone() ); | 1111 | inR = inL->clone(); |
1112 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | ||
1113 | remote->addIncidence( inR ); | ||
1108 | } | 1114 | } |
1109 | } | 1115 | } |
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp index 29e6205..1fc7169 100644 --- a/libkcal/alarm.cpp +++ b/libkcal/alarm.cpp | |||
@@ -50,4 +50,5 @@ Alarm::~Alarm() | |||
50 | bool Alarm::operator==( const Alarm& rhs ) const | 50 | bool Alarm::operator==( const Alarm& rhs ) const |
51 | { | 51 | { |
52 | |||
52 | if ( mType != rhs.mType || | 53 | if ( mType != rhs.mType || |
53 | mAlarmSnoozeTime != rhs.mAlarmSnoozeTime || | 54 | mAlarmSnoozeTime != rhs.mAlarmSnoozeTime || |
@@ -57,4 +58,38 @@ bool Alarm::operator==( const Alarm& rhs ) const | |||
57 | return false; | 58 | return false; |
58 | 59 | ||
60 | #if 0 | ||
61 | if ( mType != rhs.mType ) { | ||
62 | |||
63 | qDebug("aaa1 "); | ||
64 | return false; | ||
65 | } | ||
66 | |||
67 | if ( mAlarmSnoozeTime != rhs.mAlarmSnoozeTime ) { | ||
68 | |||
69 | qDebug("aaa2 "); | ||
70 | return false; | ||
71 | } | ||
72 | |||
73 | |||
74 | if ( mAlarmRepeatCount != rhs.mAlarmRepeatCount ) { | ||
75 | |||
76 | qDebug("aaa3 "); | ||
77 | return false; | ||
78 | } | ||
79 | |||
80 | if ( mAlarmEnabled != rhs.mAlarmEnabled ) { | ||
81 | |||
82 | qDebug("aaa4 "); | ||
83 | return false; | ||
84 | } | ||
85 | |||
86 | if ( mHasTime != rhs.mHasTime ) { | ||
87 | |||
88 | qDebug("aaa5 "); | ||
89 | return false; | ||
90 | } | ||
91 | #endif | ||
92 | |||
93 | |||
59 | if (mHasTime) { | 94 | if (mHasTime) { |
60 | if (mAlarmTime != rhs.mAlarmTime) | 95 | if (mAlarmTime != rhs.mAlarmTime) |
@@ -65,5 +100,4 @@ bool Alarm::operator==( const Alarm& rhs ) const | |||
65 | return false; | 100 | return false; |
66 | } | 101 | } |
67 | |||
68 | switch (mType) { | 102 | switch (mType) { |
69 | case Display: | 103 | case Display: |
diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp index dd74e10..e84f672 100644 --- a/libkcal/recurrence.cpp +++ b/libkcal/recurrence.cpp | |||
@@ -107,4 +107,5 @@ bool Recurrence::operator==( const Recurrence& r2 ) const | |||
107 | // differ in the other settings, because one (or both) | 107 | // differ in the other settings, because one (or both) |
108 | // may be not initialized properly | 108 | // may be not initialized properly |
109 | |||
109 | if ( recurs != r2.recurs | 110 | if ( recurs != r2.recurs |
110 | || rFreq != r2.rFreq | 111 | || rFreq != r2.rFreq |
@@ -123,16 +124,47 @@ bool Recurrence::operator==( const Recurrence& r2 ) const | |||
123 | return rDays == r2.rDays | 124 | return rDays == r2.rDays |
124 | && rWeekStart == r2.rWeekStart; | 125 | && rWeekStart == r2.rWeekStart; |
125 | case rMonthlyPos: | 126 | case rMonthlyPos: { |
126 | return rMonthPositions.count() == r2.rMonthPositions.count(); | 127 | QPtrList<rMonthPos> MonthPositions = rMonthPositions; |
127 | case rMonthlyDay: | 128 | QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; |
128 | return rMonthDays.count() == r2.rMonthDays.count(); | 129 | if ( !MonthPositions.count() ) |
129 | case rYearlyPos: | 130 | return false; |
130 | return rYearNums.count() == r2.rYearNums.count() | 131 | if ( !MonthPositions2.count() ) |
131 | && rMonthPositions.count() == r2.rMonthPositions.count(); | 132 | return false; |
132 | case rYearlyMonth: | 133 | return MonthPositions.first()->rPos == MonthPositions2.first()->rPos; |
133 | return rYearNums.count() == r2.rYearNums.count() | 134 | } |
134 | && mFeb29YearlyType == r2.mFeb29YearlyType; | 135 | case rMonthlyDay: { |
135 | case rYearlyDay: | 136 | QPtrList<int> MonthDays = rMonthDays ; |
136 | return rYearNums == r2.rYearNums; | 137 | QPtrList<int> MonthDays2 = r2.rMonthDays ; |
138 | if ( !MonthDays.count() ) | ||
139 | return false; | ||
140 | if ( !MonthDays2.count() ) | ||
141 | return false; | ||
142 | return *MonthDays.first() == *MonthDays2.first() ; | ||
143 | } | ||
144 | case rYearlyPos: { | ||
145 | |||
146 | QPtrList<int> YearNums = rYearNums; | ||
147 | QPtrList<int> YearNums2 = r2.rYearNums; | ||
148 | if ( *YearNums.first() != *YearNums2.first() ) | ||
149 | return false; | ||
150 | QPtrList<rMonthPos> MonthPositions = rMonthPositions; | ||
151 | QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; | ||
152 | if ( !MonthPositions.count() ) | ||
153 | return false; | ||
154 | if ( !MonthPositions2.count() ) | ||
155 | return false; | ||
156 | return MonthPositions.first()->rPos == MonthPositions2.first()->rPos; | ||
157 | |||
158 | } | ||
159 | case rYearlyMonth: { | ||
160 | QPtrList<int> YearNums = rYearNums; | ||
161 | QPtrList<int> YearNums2 = r2.rYearNums; | ||
162 | return ( *YearNums.first() == *YearNums2.first() && mFeb29YearlyType == r2.mFeb29YearlyType); | ||
163 | } | ||
164 | case rYearlyDay: { | ||
165 | QPtrList<int> YearNums = rYearNums; | ||
166 | QPtrList<int> YearNums2 = r2.rYearNums; | ||
167 | return ( *YearNums.first() == *YearNums2.first() ); | ||
168 | } | ||
137 | case rNone: | 169 | case rNone: |
138 | case rMinutely: | 170 | case rMinutely: |
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index defdb09..89eb72f 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp | |||
@@ -181,6 +181,7 @@ class SharpParser : public QObject | |||
181 | alarm = new Alarm( event ); | 181 | alarm = new Alarm( event ); |
182 | event->addAlarm( alarm ); | 182 | event->addAlarm( alarm ); |
183 | alarm->setType( Alarm::Audio ); | ||
183 | } | 184 | } |
184 | alarm->setType( Alarm::Audio ); | 185 | //alarm->setType( Alarm::Audio ); |
185 | alarm->setEnabled( true ); | 186 | alarm->setEnabled( true ); |
186 | int alarmOffset = attList[9].toInt(); | 187 | int alarmOffset = attList[9].toInt(); |
@@ -369,5 +370,6 @@ ulong SharpFormat::getCsum( const QStringList & attList) | |||
369 | } | 370 | } |
370 | #include <stdlib.h> | 371 | #include <stdlib.h> |
371 | #define DEBUGMODE false | 372 | //#define DEBUGMODE false |
373 | #define DEBUGMODE true | ||
372 | bool SharpFormat::load( Calendar *calendar, Calendar *existngCal ) | 374 | bool SharpFormat::load( Calendar *calendar, Calendar *existngCal ) |
373 | { | 375 | { |
@@ -375,5 +377,4 @@ bool SharpFormat::load( Calendar *calendar, Calendar *existngCal ) | |||
375 | 377 | ||
376 | bool debug = DEBUGMODE; | 378 | bool debug = DEBUGMODE; |
377 | //debug = true; | ||
378 | QString text; | 379 | QString text; |
379 | QString codec = "utf8"; | 380 | QString codec = "utf8"; |