author | zautrix <zautrix> | 2005-07-10 20:11:56 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-10 20:11:56 (UTC) |
commit | f06311e58cb5887fd673eb1c2c48acf7cd987ad9 (patch) (unidiff) | |
tree | 301c74302cdddaa3716d79117023228005ebd265 /libkcal/event.cpp | |
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 |
1 files changed, 20 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) | |||
171 | setHasEndDate(false); | 171 | setHasEndDate(false); |
172 | Incidence::setDuration(seconds); | 172 | Incidence::setDuration(seconds); |
173 | } | 173 | } |
174 | bool Event::matchTime(QDateTime*startDT, QDateTime* endDT) | ||
175 | { | ||
176 | if ( ! doesRecur() ) { | ||
177 | if ( doesFloat() ) { | ||
178 | if ( mDtEnd.addDays( 1 ) < *startDT) | ||
179 | return false; | ||
180 | if ( endDT && mDtStart > * endDT) | ||
181 | return false; | ||
182 | } else { | ||
183 | if ( mDtEnd < *startDT ) | ||
184 | return false; | ||
185 | if ( endDT && mDtStart > * endDT) | ||
186 | return false; | ||
187 | } | ||
188 | } else { | ||
189 | if ( endDT && mDtStart > * endDT) | ||
190 | return false; | ||
191 | } | ||
192 | return true; | ||
193 | } | ||
174 | bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, QDateTime* startDT ) | 194 | bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, QDateTime* startDT ) |
175 | { | 195 | { |
176 | if ( testEvent == this ) | 196 | if ( testEvent == this ) |