author | zautrix <zautrix> | 2005-07-07 21:34:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-07 21:34:31 (UTC) |
commit | 3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc (patch) (unidiff) | |
tree | 6fceb199e62afe671ed34acb308749ea09cac578 /libkcal | |
parent | de5621f2fd3924f27c05459ae555b3bd06c5e584 (diff) | |
download | kdepimpi-3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc.zip kdepimpi-3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc.tar.gz kdepimpi-3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc.tar.bz2 |
fixxx
-rw-r--r-- | libkcal/event.cpp | 16 | ||||
-rw-r--r-- | libkcal/event.h | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/libkcal/event.cpp b/libkcal/event.cpp index 235ae55..46e8174 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp | |||
@@ -170,9 +170,9 @@ void Event::setDuration(int seconds) | |||
170 | { | 170 | { |
171 | setHasEndDate(false); | 171 | setHasEndDate(false); |
172 | Incidence::setDuration(seconds); | 172 | Incidence::setDuration(seconds); |
173 | } | 173 | } |
174 | bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFutureOnly ) | 174 | bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, QDateTime* startDT ) |
175 | { | 175 | { |
176 | if ( testEvent == this ) | 176 | if ( testEvent == this ) |
177 | return false; | 177 | return false; |
178 | if ( ! doesRecur() && !testEvent->doesRecur() ) { | 178 | if ( ! doesRecur() && !testEvent->doesRecur() ) { |
@@ -190,10 +190,10 @@ bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFut | |||
190 | if ( mDtStart < testEvent->mDtStart ) | 190 | if ( mDtStart < testEvent->mDtStart ) |
191 | *overlapDT = testEvent->mDtStart; | 191 | *overlapDT = testEvent->mDtStart; |
192 | else | 192 | else |
193 | *overlapDT = mDtStart; | 193 | *overlapDT = mDtStart; |
194 | if ( inFutureOnly ) | 194 | if ( startDT ) |
195 | return (*overlapDT >= QDateTime::currentDateTime() ); | 195 | return (*overlapDT >= *startDT ); |
196 | return true; | 196 | return true; |
197 | } | 197 | } |
198 | return false; | 198 | return false; |
199 | } | 199 | } |
@@ -214,9 +214,9 @@ bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFut | |||
214 | else | 214 | else |
215 | enr = nonRecur->mDtEnd; | 215 | enr = nonRecur->mDtEnd; |
216 | if ( enr < recurEvent->mDtStart ) | 216 | if ( enr < recurEvent->mDtStart ) |
217 | return false; | 217 | return false; |
218 | if ( inFutureOnly && enr < QDateTime::currentDateTime() ) | 218 | if ( startDT && enr < *startDT ) |
219 | return false; | 219 | return false; |
220 | int recDuration = recurEvent->mDtStart.secsTo( recurEvent->mDtEnd ); | 220 | int recDuration = recurEvent->mDtStart.secsTo( recurEvent->mDtEnd ); |
221 | if ( recurEvent->doesFloat() ) | 221 | if ( recurEvent->doesFloat() ) |
222 | recDuration += 86400; | 222 | recDuration += 86400; |
@@ -232,10 +232,10 @@ bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFut | |||
232 | if ( nonRecur->mDtStart < recStart ) | 232 | if ( nonRecur->mDtStart < recStart ) |
233 | *overlapDT = recStart; | 233 | *overlapDT = recStart; |
234 | else | 234 | else |
235 | *overlapDT = nonRecur->mDtStart; | 235 | *overlapDT = nonRecur->mDtStart; |
236 | if ( inFutureOnly ) { | 236 | if ( startDT ) { |
237 | if ( *overlapDT >= QDateTime::currentDateTime() ) | 237 | if ( *overlapDT >= *startDT ) |
238 | return true; | 238 | return true; |
239 | } else | 239 | } else |
240 | return true; | 240 | return true; |
241 | } | 241 | } |
@@ -273,10 +273,10 @@ bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFut | |||
273 | if ( incidenceStart < testincidenceStart ) | 273 | if ( incidenceStart < testincidenceStart ) |
274 | *overlapDT = testincidenceStart; | 274 | *overlapDT = testincidenceStart; |
275 | else | 275 | else |
276 | *overlapDT = incidenceStart; | 276 | *overlapDT = incidenceStart; |
277 | if ( inFutureOnly ) { | 277 | if ( startDT ) { |
278 | if ( *overlapDT >= QDateTime::currentDateTime() ) | 278 | if ( *overlapDT >= *startDT ) |
279 | return true; | 279 | return true; |
280 | } else | 280 | } else |
281 | return true; | 281 | return true; |
282 | } | 282 | } |
diff --git a/libkcal/event.h b/libkcal/event.h index 80c11c4..e6055a5 100644 --- a/libkcal/event.h +++ b/libkcal/event.h | |||
@@ -73,9 +73,9 @@ class Event : public Incidence | |||
73 | void setDuration(int seconds); | 73 | void setDuration(int seconds); |
74 | 74 | ||
75 | bool contains ( Event*); | 75 | bool contains ( Event*); |
76 | 76 | ||
77 | bool isOverlapping ( Event*, QDateTime*, bool inFutureOnly ); | 77 | bool isOverlapping ( Event*, QDateTime*, QDateTime* ); |
78 | 78 | ||
79 | private: | 79 | private: |
80 | bool accept(Visitor &v) { return v.visit(this); } | 80 | bool accept(Visitor &v) { return v.visit(this); } |
81 | 81 | ||