-rw-r--r-- | libkcal/event.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libkcal/event.cpp b/libkcal/event.cpp index 235ae55..46e8174 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp | |||
@@ -171,7 +171,7 @@ void Event::setDuration(int seconds) | |||
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; |
@@ -191,8 +191,8 @@ bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFut | |||
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; |
@@ -215,7 +215,7 @@ bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFut | |||
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() ) |
@@ -233,8 +233,8 @@ bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFut | |||
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; |
@@ -274,8 +274,8 @@ bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFut | |||
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; |