author | zautrix <zautrix> | 2005-07-10 20:11:56 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-10 20:11:56 (UTC) |
commit | f06311e58cb5887fd673eb1c2c48acf7cd987ad9 (patch) (side-by-side diff) | |
tree | 301c74302cdddaa3716d79117023228005ebd265 /libkcal | |
parent | cb784d21ad22ab72a4e3231974f67816185675fd (diff) | |
download | kdepimpi-f06311e58cb5887fd673eb1c2c48acf7cd987ad9.zip kdepimpi-f06311e58cb5887fd673eb1c2c48acf7cd987ad9.tar.gz kdepimpi-f06311e58cb5887fd673eb1c2c48acf7cd987ad9.tar.bz2 |
smarter faster conflict search
-rw-r--r-- | libkcal/event.cpp | 20 | ||||
-rw-r--r-- | libkcal/event.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/libkcal/event.cpp b/libkcal/event.cpp index 5285559..ad66639 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp @@ -171,6 +171,26 @@ void Event::setDuration(int seconds) setHasEndDate(false); Incidence::setDuration(seconds); } +bool Event::matchTime(QDateTime*startDT, QDateTime* endDT) +{ + if ( ! doesRecur() ) { + if ( doesFloat() ) { + if ( mDtEnd.addDays( 1 ) < *startDT) + return false; + if ( endDT && mDtStart > * endDT) + return false; + } else { + if ( mDtEnd < *startDT ) + return false; + if ( endDT && mDtStart > * endDT) + return false; + } + } else { + if ( endDT && mDtStart > * endDT) + return false; + } + return true; +} bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, QDateTime* startDT ) { if ( testEvent == this ) diff --git a/libkcal/event.h b/libkcal/event.h index e6055a5..2da9770 100644 --- a/libkcal/event.h +++ b/libkcal/event.h @@ -38,6 +38,7 @@ class Event : public Incidence Event(); Event(const Event &); ~Event(); + bool matchTime(QDateTime*startDT, QDateTime* endDT); QCString type() const { return "Event"; } IncTypeID typeID() const { return eventID; } |