author | zautrix <zautrix> | 2005-07-27 22:26:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-27 22:26:08 (UTC) |
commit | 0e38cffd7ba745f237c659e1c48080fcb25b126c (patch) (unidiff) | |
tree | 6069600e18bae5300c6ce427735457dbfed93141 /libkcal/event.cpp | |
parent | 136f9082862e7a56abb3a201e96f5e7386c4f1b9 (diff) | |
download | kdepimpi-0e38cffd7ba745f237c659e1c48080fcb25b126c.zip kdepimpi-0e38cffd7ba745f237c659e1c48080fcb25b126c.tar.gz kdepimpi-0e38cffd7ba745f237c659e1c48080fcb25b126c.tar.bz2 |
rec changes
-rw-r--r-- | libkcal/event.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libkcal/event.cpp b/libkcal/event.cpp index ad66639..0766fd9 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp | |||
@@ -128,96 +128,97 @@ QString Event::dtEndTimeStr() const | |||
128 | return KGlobal::locale()->formatTime(mDtEnd.time()); | 128 | return KGlobal::locale()->formatTime(mDtEnd.time()); |
129 | } | 129 | } |
130 | 130 | ||
131 | QString Event::dtEndDateStr(bool shortfmt) const | 131 | QString Event::dtEndDateStr(bool shortfmt) const |
132 | { | 132 | { |
133 | return KGlobal::locale()->formatDate(mDtEnd.date(),shortfmt); | 133 | return KGlobal::locale()->formatDate(mDtEnd.date(),shortfmt); |
134 | } | 134 | } |
135 | 135 | ||
136 | QString Event::dtEndStr(bool shortfmt) const | 136 | QString Event::dtEndStr(bool shortfmt) const |
137 | { | 137 | { |
138 | return KGlobal::locale()->formatDateTime(mDtEnd, shortfmt); | 138 | return KGlobal::locale()->formatDateTime(mDtEnd, shortfmt); |
139 | } | 139 | } |
140 | 140 | ||
141 | void Event::setHasEndDate(bool b) | 141 | void Event::setHasEndDate(bool b) |
142 | { | 142 | { |
143 | mHasEndDate = b; | 143 | mHasEndDate = b; |
144 | } | 144 | } |
145 | 145 | ||
146 | bool Event::hasEndDate() const | 146 | bool Event::hasEndDate() const |
147 | { | 147 | { |
148 | return mHasEndDate; | 148 | return mHasEndDate; |
149 | } | 149 | } |
150 | 150 | ||
151 | bool Event::isMultiDay() const | 151 | bool Event::isMultiDay() const |
152 | { | 152 | { |
153 | bool multi = !(dtStart().date() == dtEnd().date()); | 153 | bool multi = !(dtStart().date() == dtEnd().date()); |
154 | return multi; | 154 | return multi; |
155 | } | 155 | } |
156 | 156 | ||
157 | void Event::setTransparency(Event::Transparency transparency) | 157 | void Event::setTransparency(Event::Transparency transparency) |
158 | { | 158 | { |
159 | if (mReadOnly) return; | 159 | if (mReadOnly) return; |
160 | mTransparency = transparency; | 160 | mTransparency = transparency; |
161 | updated(); | 161 | updated(); |
162 | } | 162 | } |
163 | 163 | ||
164 | Event::Transparency Event::transparency() const | 164 | Event::Transparency Event::transparency() const |
165 | { | 165 | { |
166 | return mTransparency; | 166 | return mTransparency; |
167 | } | 167 | } |
168 | 168 | ||
169 | void Event::setDuration(int seconds) | 169 | 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::matchTime(QDateTime*startDT, QDateTime* endDT) | 174 | bool Event::matchTime(QDateTime*startDT, QDateTime* endDT) |
175 | { | 175 | { |
176 | if ( cancelled() ) return false; | ||
176 | if ( ! doesRecur() ) { | 177 | if ( ! doesRecur() ) { |
177 | if ( doesFloat() ) { | 178 | if ( doesFloat() ) { |
178 | if ( mDtEnd.addDays( 1 ) < *startDT) | 179 | if ( mDtEnd.addDays( 1 ) < *startDT) |
179 | return false; | 180 | return false; |
180 | if ( endDT && mDtStart > * endDT) | 181 | if ( endDT && mDtStart > * endDT) |
181 | return false; | 182 | return false; |
182 | } else { | 183 | } else { |
183 | if ( mDtEnd < *startDT ) | 184 | if ( mDtEnd < *startDT ) |
184 | return false; | 185 | return false; |
185 | if ( endDT && mDtStart > * endDT) | 186 | if ( endDT && mDtStart > * endDT) |
186 | return false; | 187 | return false; |
187 | } | 188 | } |
188 | } else { | 189 | } else { |
189 | if ( endDT && mDtStart > * endDT) | 190 | if ( endDT && mDtStart > * endDT) |
190 | return false; | 191 | return false; |
191 | } | 192 | } |
192 | return true; | 193 | return true; |
193 | } | 194 | } |
194 | bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, QDateTime* startDT ) | 195 | bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, QDateTime* startDT ) |
195 | { | 196 | { |
196 | if ( testEvent == this ) | 197 | if ( testEvent == this ) |
197 | return false; | 198 | return false; |
198 | if ( ! doesRecur() && !testEvent->doesRecur() ) { | 199 | if ( ! doesRecur() && !testEvent->doesRecur() ) { |
199 | QDateTime te; | 200 | QDateTime te; |
200 | if ( testEvent->doesFloat() ) | 201 | if ( testEvent->doesFloat() ) |
201 | te = testEvent->mDtEnd.addDays( 1 ); | 202 | te = testEvent->mDtEnd.addDays( 1 ); |
202 | else | 203 | else |
203 | te = testEvent->mDtEnd; | 204 | te = testEvent->mDtEnd; |
204 | QDateTime e; | 205 | QDateTime e; |
205 | if ( doesFloat() ) | 206 | if ( doesFloat() ) |
206 | e = mDtEnd.addDays( 1 ); | 207 | e = mDtEnd.addDays( 1 ); |
207 | else | 208 | else |
208 | e = mDtEnd; | 209 | e = mDtEnd; |
209 | if ( mDtStart < te && testEvent->mDtStart < e ) { | 210 | if ( mDtStart < te && testEvent->mDtStart < e ) { |
210 | if ( mDtStart < testEvent->mDtStart ) | 211 | if ( mDtStart < testEvent->mDtStart ) |
211 | *overlapDT = testEvent->mDtStart; | 212 | *overlapDT = testEvent->mDtStart; |
212 | else | 213 | else |
213 | *overlapDT = mDtStart; | 214 | *overlapDT = mDtStart; |
214 | if ( startDT ) | 215 | if ( startDT ) |
215 | return (*overlapDT >= *startDT ); | 216 | return (*overlapDT >= *startDT ); |
216 | return true; | 217 | return true; |
217 | } | 218 | } |
218 | return false; | 219 | return false; |
219 | } | 220 | } |
220 | if ( !doesFloat() && !testEvent->doesFloat() && !isMultiDay() && !testEvent->isMultiDay() ) { | 221 | if ( !doesFloat() && !testEvent->doesFloat() && !isMultiDay() && !testEvent->isMultiDay() ) { |
221 | if ( mDtStart.time() >= testEvent->mDtEnd.time() || testEvent->mDtStart.time() >= mDtEnd.time() ) { | 222 | if ( mDtStart.time() >= testEvent->mDtEnd.time() || testEvent->mDtStart.time() >= mDtEnd.time() ) { |
222 | // no need to test. times mismatch | 223 | // no need to test. times mismatch |
223 | //fprintf(stderr,"timi "); | 224 | //fprintf(stderr,"timi "); |