summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/event.cpp16
-rw-r--r--libkcal/event.h2
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
@@ -172,5 +172,5 @@ void Event::setDuration(int seconds)
Incidence::setDuration(seconds);
}
-bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFutureOnly )
+bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, QDateTime* startDT )
{
if ( testEvent == this )
@@ -192,6 +192,6 @@ bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFut
else
*overlapDT = mDtStart;
- if ( inFutureOnly )
- return (*overlapDT >= QDateTime::currentDateTime() );
+ if ( startDT )
+ return (*overlapDT >= *startDT );
return true;
}
@@ -216,5 +216,5 @@ bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFut
if ( enr < recurEvent->mDtStart )
return false;
- if ( inFutureOnly && enr < QDateTime::currentDateTime() )
+ if ( startDT && enr < *startDT )
return false;
int recDuration = recurEvent->mDtStart.secsTo( recurEvent->mDtEnd );
@@ -234,6 +234,6 @@ bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFut
else
*overlapDT = nonRecur->mDtStart;
- if ( inFutureOnly ) {
- if ( *overlapDT >= QDateTime::currentDateTime() )
+ if ( startDT ) {
+ if ( *overlapDT >= *startDT )
return true;
} else
@@ -275,6 +275,6 @@ bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFut
else
*overlapDT = incidenceStart;
- if ( inFutureOnly ) {
- if ( *overlapDT >= QDateTime::currentDateTime() )
+ if ( startDT ) {
+ if ( *overlapDT >= *startDT )
return true;
} else
diff --git a/libkcal/event.h b/libkcal/event.h
index 80c11c4..e6055a5 100644
--- a/libkcal/event.h
+++ b/libkcal/event.h
@@ -75,5 +75,5 @@ class Event : public Incidence
bool contains ( Event*);
- bool isOverlapping ( Event*, QDateTime*, bool inFutureOnly );
+ bool isOverlapping ( Event*, QDateTime*, QDateTime* );
private: