author | zecke <zecke> | 2004-10-17 18:38:39 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-10-17 18:38:39 (UTC) |
commit | e95fcb09fc069a83b3c10c19c081873daba49831 (patch) (unidiff) | |
tree | 13d13bac82d5bcf2489075e4f2962685ff3c897d /library | |
parent | 7e28835e246e06e157d760a40754b6257f2ad6b3 (diff) | |
download | opie-e95fcb09fc069a83b3c10c19c081873daba49831.zip opie-e95fcb09fc069a83b3c10c19c081873daba49831.tar.gz opie-e95fcb09fc069a83b3c10c19c081873daba49831.tar.bz2 |
G++ 4.0 compiler fixes
-Remove anonymous structures and name them
-Include 'card.h' to cardpile to make 'Card' known to QList
so deleteItem will work
-cast 'enum' to char in event.cpp and opimevent.cpp
-rw-r--r-- | library/backend/event.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/backend/event.cpp b/library/backend/event.cpp index 90860e8..abc420b 100644 --- a/library/backend/event.cpp +++ b/library/backend/event.cpp | |||
@@ -146,513 +146,513 @@ Qtopia::UidGen Event::sUidGen( Qtopia::UidGen::Qtopia ); | |||
146 | <li>\c MonthlyDay - Event occurs every n months. Event will always occur in | 146 | <li>\c MonthlyDay - Event occurs every n months. Event will always occur in |
147 | the same week and same day of week as the first event. | 147 | the same week and same day of week as the first event. |
148 | <li>\c MonthlyDate - Event occurs every n months. Event will always occur | 148 | <li>\c MonthlyDate - Event occurs every n months. Event will always occur |
149 | on the same day of the month as the first event. | 149 | on the same day of the month as the first event. |
150 | <li>\c Yearly - Event occurs every n years. | 150 | <li>\c Yearly - Event occurs every n years. |
151 | </ul> | 151 | </ul> |
152 | */ | 152 | */ |
153 | 153 | ||
154 | /*! | 154 | /*! |
155 | \fn bool Event::isAllDay() const | 155 | \fn bool Event::isAllDay() const |
156 | 156 | ||
157 | Returns TRUE if the event is an all day event. Otherwise returns FALSE. | 157 | Returns TRUE if the event is an all day event. Otherwise returns FALSE. |
158 | */ | 158 | */ |
159 | 159 | ||
160 | /*! | 160 | /*! |
161 | \fn void Event::setAllDay(bool allday) | 161 | \fn void Event::setAllDay(bool allday) |
162 | 162 | ||
163 | If \a allday is TRUE, will set the event to be an all day event. | 163 | If \a allday is TRUE, will set the event to be an all day event. |
164 | Otherwise sets the event to not be an all day event. | 164 | Otherwise sets the event to not be an all day event. |
165 | 165 | ||
166 | \warning This function may affect the start and end times of the event. | 166 | \warning This function may affect the start and end times of the event. |
167 | */ | 167 | */ |
168 | 168 | ||
169 | /*! | 169 | /*! |
170 | \fn QDateTime Event::start(bool) const | 170 | \fn QDateTime Event::start(bool) const |
171 | 171 | ||
172 | Returns the start date and time of the first occurance of the event. | 172 | Returns the start date and time of the first occurance of the event. |
173 | */ | 173 | */ |
174 | 174 | ||
175 | /*! | 175 | /*! |
176 | \fn QDateTime Event::end(bool) const | 176 | \fn QDateTime Event::end(bool) const |
177 | 177 | ||
178 | Returns the end date and time of the first occurance of the event. | 178 | Returns the end date and time of the first occurance of the event. |
179 | */ | 179 | */ |
180 | 180 | ||
181 | /*! | 181 | /*! |
182 | \fn time_t Event::startTime() const | 182 | \fn time_t Event::startTime() const |
183 | \internal | 183 | \internal |
184 | */ | 184 | */ |
185 | 185 | ||
186 | /*! | 186 | /*! |
187 | \fn time_t Event::endTime() const | 187 | \fn time_t Event::endTime() const |
188 | \internal | 188 | \internal |
189 | */ | 189 | */ |
190 | 190 | ||
191 | /*! | 191 | /*! |
192 | \fn void Event::setAlarm(int delay, SoundTypeChoice s) | 192 | \fn void Event::setAlarm(int delay, SoundTypeChoice s) |
193 | 193 | ||
194 | Sets the alarm delay of the event to \a delay and the sound type of the | 194 | Sets the alarm delay of the event to \a delay and the sound type of the |
195 | alarm to \a s. | 195 | alarm to \a s. |
196 | */ | 196 | */ |
197 | 197 | ||
198 | /*! | 198 | /*! |
199 | \fn void Event::clearAlarm() | 199 | \fn void Event::clearAlarm() |
200 | 200 | ||
201 | Clears the alarm for the event. | 201 | Clears the alarm for the event. |
202 | */ | 202 | */ |
203 | 203 | ||
204 | /*! | 204 | /*! |
205 | \fn int Event::alarmDelay() const | 205 | \fn int Event::alarmDelay() const |
206 | 206 | ||
207 | Returns the delay in minutes between the alarm for an event and the | 207 | Returns the delay in minutes between the alarm for an event and the |
208 | start of the event. | 208 | start of the event. |
209 | */ | 209 | */ |
210 | 210 | ||
211 | /*! | 211 | /*! |
212 | \fn Event::RepeatType Event::repeatType() const | 212 | \fn Event::RepeatType Event::repeatType() const |
213 | 213 | ||
214 | Returns the repeat pattern type for the event. | 214 | Returns the repeat pattern type for the event. |
215 | 215 | ||
216 | \sa frequency() | 216 | \sa frequency() |
217 | */ | 217 | */ |
218 | 218 | ||
219 | /*! | 219 | /*! |
220 | \fn int Event::weekOffset() const | 220 | \fn int Event::weekOffset() const |
221 | 221 | ||
222 | Returns the number of weeks from the start of the month that this event | 222 | Returns the number of weeks from the start of the month that this event |
223 | occurs. | 223 | occurs. |
224 | */ | 224 | */ |
225 | 225 | ||
226 | /*! | 226 | /*! |
227 | \fn QDate Event::repeatTill() const | 227 | \fn QDate Event::repeatTill() const |
228 | 228 | ||
229 | Returns the date that the event will continue to repeat until. If the event | 229 | Returns the date that the event will continue to repeat until. If the event |
230 | repeats forever the value returned is undefined. | 230 | repeats forever the value returned is undefined. |
231 | 231 | ||
232 | \sa repeatForever() | 232 | \sa repeatForever() |
233 | */ | 233 | */ |
234 | 234 | ||
235 | /*! | 235 | /*! |
236 | \fn bool Event::repeatForever() const | 236 | \fn bool Event::repeatForever() const |
237 | 237 | ||
238 | Returns FALSE if there is a date set for the event to continue until. | 238 | Returns FALSE if there is a date set for the event to continue until. |
239 | Otherwise returns TRUE. | 239 | Otherwise returns TRUE. |
240 | */ | 240 | */ |
241 | 241 | ||
242 | /*! | 242 | /*! |
243 | \fn bool Event::doRepeat() const | 243 | \fn bool Event::doRepeat() const |
244 | \internal | 244 | \internal |
245 | */ | 245 | */ |
246 | 246 | ||
247 | /*! | 247 | /*! |
248 | \fn bool Event::repeatOnWeekDay(int day) const | 248 | \fn bool Event::repeatOnWeekDay(int day) const |
249 | 249 | ||
250 | Returns TRUE if the event has a RepeatType of Weekly and is set to occur on | 250 | Returns TRUE if the event has a RepeatType of Weekly and is set to occur on |
251 | \a day each week. Otherwise returns FALSE. | 251 | \a day each week. Otherwise returns FALSE. |
252 | 252 | ||
253 | \sa QDate::dayName() | 253 | \sa QDate::dayName() |
254 | */ | 254 | */ |
255 | 255 | ||
256 | /*! | 256 | /*! |
257 | \fn void Event::setRepeatOnWeekDay(int day, bool enable) | 257 | \fn void Event::setRepeatOnWeekDay(int day, bool enable) |
258 | 258 | ||
259 | If \a enable is TRUE then sets the event to occur on \a day each week. | 259 | If \a enable is TRUE then sets the event to occur on \a day each week. |
260 | Otherwise sets the event not to occur on \a day. | 260 | Otherwise sets the event not to occur on \a day. |
261 | 261 | ||
262 | \warning this function is only relavent for a event with RepeatType of | 262 | \warning this function is only relavent for a event with RepeatType of |
263 | Weekly. | 263 | Weekly. |
264 | 264 | ||
265 | \sa QDate::dayName() | 265 | \sa QDate::dayName() |
266 | */ | 266 | */ |
267 | 267 | ||
268 | /*! | 268 | /*! |
269 | \fn int Event::frequency() const | 269 | \fn int Event::frequency() const |
270 | 270 | ||
271 | Returns how often the event repeats. | 271 | Returns how often the event repeats. |
272 | 272 | ||
273 | \sa repeatType() | 273 | \sa repeatType() |
274 | */ | 274 | */ |
275 | 275 | ||
276 | /*! | 276 | /*! |
277 | \fn void Event::setRepeatType(RepeatType t) | 277 | \fn void Event::setRepeatType(RepeatType t) |
278 | 278 | ||
279 | Sets the repeat pattern type of the event to \a t. | 279 | Sets the repeat pattern type of the event to \a t. |
280 | 280 | ||
281 | \sa setFrequency() | 281 | \sa setFrequency() |
282 | */ | 282 | */ |
283 | 283 | ||
284 | /*! | 284 | /*! |
285 | \fn void Event::setFrequency(int n) | 285 | \fn void Event::setFrequency(int n) |
286 | 286 | ||
287 | Sets how often the event occurs with in its repeat pattern. | 287 | Sets how often the event occurs with in its repeat pattern. |
288 | 288 | ||
289 | \sa setRepeatType() | 289 | \sa setRepeatType() |
290 | */ | 290 | */ |
291 | 291 | ||
292 | /*! | 292 | /*! |
293 | \fn void Event::setRepeatTill(const QDate &d) | 293 | \fn void Event::setRepeatTill(const QDate &d) |
294 | 294 | ||
295 | Sets the event to repeat until \a d. | 295 | Sets the event to repeat until \a d. |
296 | */ | 296 | */ |
297 | 297 | ||
298 | /*! | 298 | /*! |
299 | \fn void Event::setRepeatForever(bool enable) | 299 | \fn void Event::setRepeatForever(bool enable) |
300 | 300 | ||
301 | If \a enable is TRUE, sets the event to repeat forever. Otherwise | 301 | If \a enable is TRUE, sets the event to repeat forever. Otherwise |
302 | sets the event to stop repeating at some date. | 302 | sets the event to stop repeating at some date. |
303 | 303 | ||
304 | \warning This function may affect the specific date the event will repeat | 304 | \warning This function may affect the specific date the event will repeat |
305 | till. | 305 | till. |
306 | */ | 306 | */ |
307 | 307 | ||
308 | /*! | 308 | /*! |
309 | \fn bool Event::match(const QRegExp &r) const | 309 | \fn bool Event::match(const QRegExp &r) const |
310 | 310 | ||
311 | Returns TRUE if the event matches the regular expression \a r. | 311 | Returns TRUE if the event matches the regular expression \a r. |
312 | Otherwise returns FALSE. | 312 | Otherwise returns FALSE. |
313 | */ | 313 | */ |
314 | 314 | ||
315 | /*! | 315 | /*! |
316 | \fn char Event::day(int) | 316 | \fn char Event::day(int) |
317 | \internal | 317 | \internal |
318 | */ | 318 | */ |
319 | 319 | ||
320 | /*! | 320 | /*! |
321 | Creates a new, empty event. | 321 | Creates a new, empty event. |
322 | */ | 322 | */ |
323 | Event::Event() : Record() | 323 | Event::Event() : Record() |
324 | { | 324 | { |
325 | startUTC = endUTC = time( 0 ); | 325 | startUTC = endUTC = time( 0 ); |
326 | typ = Normal; | 326 | typ = Normal; |
327 | hAlarm = FALSE; | 327 | hAlarm = FALSE; |
328 | hRepeat = FALSE; | 328 | hRepeat = FALSE; |
329 | aMinutes = 0; | 329 | aMinutes = 0; |
330 | aSound = Silent; | 330 | aSound = Silent; |
331 | pattern.type = NoRepeat; | 331 | pattern.type = NoRepeat; |
332 | pattern.frequency = -1; | 332 | pattern.frequency = -1; |
333 | } | 333 | } |
334 | 334 | ||
335 | /*! | 335 | /*! |
336 | \internal | 336 | \internal |
337 | */ | 337 | */ |
338 | Event::Event( const QMap<int, QString> &map ) | 338 | Event::Event( const QMap<int, QString> &map ) |
339 | { | 339 | { |
340 | setDescription( map[DatebookDescription] ); | 340 | setDescription( map[DatebookDescription] ); |
341 | setLocation( map[Location] ); | 341 | setLocation( map[Location] ); |
342 | setCategories( idsFromString( map[DatebookCategory] ) ); | 342 | setCategories( idsFromString( map[DatebookCategory] ) ); |
343 | setTimeZone( map[TimeZone] ); | 343 | setTimeZone( map[TimeZone] ); |
344 | setNotes( map[Note] ); | 344 | setNotes( map[Note] ); |
345 | setStart( TimeConversion::fromUTC( map[StartDateTime].toUInt() ) ); | 345 | setStart( TimeConversion::fromUTC( map[StartDateTime].toUInt() ) ); |
346 | setEnd( TimeConversion::fromUTC( map[EndDateTime].toUInt() ) ); | 346 | setEnd( TimeConversion::fromUTC( map[EndDateTime].toUInt() ) ); |
347 | setType( (Event::Type) map[DatebookType].toInt() ); | 347 | setType( (Event::Type) map[DatebookType].toInt() ); |
348 | setAlarm( ( map[HasAlarm] == "1" ? TRUE : FALSE ), map[AlarmTime].toInt(), (Event::SoundTypeChoice)map[SoundType].toInt() ); | 348 | setAlarm( ( map[HasAlarm] == "1" ? TRUE : FALSE ), map[AlarmTime].toInt(), (Event::SoundTypeChoice)map[SoundType].toInt() ); |
349 | Event::RepeatPattern p; | 349 | Event::RepeatPattern p; |
350 | p.type = (Event::RepeatType) map[ RepeatPatternType ].toInt(); | 350 | p.type = (Event::RepeatType) map[ RepeatPatternType ].toInt(); |
351 | p.frequency = map[ RepeatPatternFrequency ].toInt(); | 351 | p.frequency = map[ RepeatPatternFrequency ].toInt(); |
352 | p.position = map[ RepeatPatternPosition ].toInt(); | 352 | p.position = map[ RepeatPatternPosition ].toInt(); |
353 | p.days = map[ RepeatPatternDays ].toInt(); | 353 | p.days = map[ RepeatPatternDays ].toInt(); |
354 | p.hasEndDate = map[ RepeatPatternHasEndDate ].toInt(); | 354 | p.hasEndDate = map[ RepeatPatternHasEndDate ].toInt(); |
355 | p.endDateUTC = map[ RepeatPatternEndDate ].toUInt(); | 355 | p.endDateUTC = map[ RepeatPatternEndDate ].toUInt(); |
356 | setRepeat( p ); | 356 | setRepeat( p ); |
357 | 357 | ||
358 | setUid( map[ DatebookUid ].toInt() ); | 358 | setUid( map[ DatebookUid ].toInt() ); |
359 | } | 359 | } |
360 | 360 | ||
361 | /*! | 361 | /*! |
362 | Destroys an event. | 362 | Destroys an event. |
363 | */ | 363 | */ |
364 | Event::~Event() | 364 | Event::~Event() |
365 | { | 365 | { |
366 | } | 366 | } |
367 | 367 | ||
368 | /*! | 368 | /*! |
369 | \internal | 369 | \internal |
370 | */ | 370 | */ |
371 | int Event::week( const QDate& date ) | 371 | int Event::week( const QDate& date ) |
372 | { | 372 | { |
373 | // Calculates the week this date is in within that | 373 | // Calculates the week this date is in within that |
374 | // month. Equals the "row" is is in in the month view | 374 | // month. Equals the "row" is is in in the month view |
375 | int week = 1; | 375 | int week = 1; |
376 | QDate tmp( date.year(), date.month(), 1 ); | 376 | QDate tmp( date.year(), date.month(), 1 ); |
377 | 377 | ||
378 | if ( date.dayOfWeek() < tmp.dayOfWeek() ) | 378 | if ( date.dayOfWeek() < tmp.dayOfWeek() ) |
379 | ++week; | 379 | ++week; |
380 | 380 | ||
381 | week += ( date.day() - 1 ) / 7; | 381 | week += ( date.day() - 1 ) / 7; |
382 | return week; | 382 | return week; |
383 | } | 383 | } |
384 | 384 | ||
385 | /*! | 385 | /*! |
386 | \internal | 386 | \internal |
387 | */ | 387 | */ |
388 | int Event::occurrence( const QDate& date ) | 388 | int Event::occurrence( const QDate& date ) |
389 | { | 389 | { |
390 | // calculates the number of occurrances of this day of the | 390 | // calculates the number of occurrances of this day of the |
391 | // week till the given date (e.g 3rd Wednesday of the month) | 391 | // week till the given date (e.g 3rd Wednesday of the month) |
392 | return ( date.day() - 1 ) / 7 + 1; | 392 | return ( date.day() - 1 ) / 7 + 1; |
393 | } | 393 | } |
394 | 394 | ||
395 | /*! | 395 | /*! |
396 | \internal | 396 | \internal |
397 | */ | 397 | */ |
398 | int Event::dayOfWeek( char day ) | 398 | int Event::dayOfWeek( char day ) |
399 | { | 399 | { |
400 | int dayOfWeek = 1; | 400 | int dayOfWeek = 1; |
401 | char i = Event::MON; | 401 | char i = Event::MON; |
402 | while ( !( i & day ) && i <= Event::SUN ) { | 402 | while ( !( i & day ) && i <= static_cast<char>(Event::SUN) ) { |
403 | i <<= 1; | 403 | i <<= 1; |
404 | ++dayOfWeek; | 404 | ++dayOfWeek; |
405 | } | 405 | } |
406 | return dayOfWeek; | 406 | return dayOfWeek; |
407 | } | 407 | } |
408 | 408 | ||
409 | /*! | 409 | /*! |
410 | \internal | 410 | \internal |
411 | */ | 411 | */ |
412 | int Event::monthDiff( const QDate& first, const QDate& second ) | 412 | int Event::monthDiff( const QDate& first, const QDate& second ) |
413 | { | 413 | { |
414 | return ( second.year() - first.year() ) * 12 + | 414 | return ( second.year() - first.year() ) * 12 + |
415 | second.month() - first.month(); | 415 | second.month() - first.month(); |
416 | } | 416 | } |
417 | 417 | ||
418 | /*! | 418 | /*! |
419 | \internal | 419 | \internal |
420 | */ | 420 | */ |
421 | QMap<int, QString> Event::toMap() const | 421 | QMap<int, QString> Event::toMap() const |
422 | { | 422 | { |
423 | QMap<int, QString> m; | 423 | QMap<int, QString> m; |
424 | 424 | ||
425 | if ( !description().isEmpty() ) | 425 | if ( !description().isEmpty() ) |
426 | m.insert( DatebookDescription, description() ); | 426 | m.insert( DatebookDescription, description() ); |
427 | if ( !location().isEmpty() ) | 427 | if ( !location().isEmpty() ) |
428 | m.insert ( Location, location() ); | 428 | m.insert ( Location, location() ); |
429 | if ( categories().count() ) | 429 | if ( categories().count() ) |
430 | m.insert ( DatebookCategory, idsToString( categories() ) ); | 430 | m.insert ( DatebookCategory, idsToString( categories() ) ); |
431 | if ( !timeZone().isEmpty() ) | 431 | if ( !timeZone().isEmpty() ) |
432 | m.insert ( TimeZone, timeZone() ); | 432 | m.insert ( TimeZone, timeZone() ); |
433 | if ( !notes().isEmpty() ) | 433 | if ( !notes().isEmpty() ) |
434 | m.insert ( Note, notes() ); | 434 | m.insert ( Note, notes() ); |
435 | 435 | ||
436 | m.insert ( StartDateTime, QString::number( TimeConversion::toUTC( start() ) ) ); | 436 | m.insert ( StartDateTime, QString::number( TimeConversion::toUTC( start() ) ) ); |
437 | m.insert ( EndDateTime, QString::number( TimeConversion::toUTC( end() ) ) ); | 437 | m.insert ( EndDateTime, QString::number( TimeConversion::toUTC( end() ) ) ); |
438 | m.insert ( DatebookType, QString::number( (int)type() ) ); | 438 | m.insert ( DatebookType, QString::number( (int)type() ) ); |
439 | m.insert ( HasAlarm, ( hasAlarm() ? "1" : "0" ) ); | 439 | m.insert ( HasAlarm, ( hasAlarm() ? "1" : "0" ) ); |
440 | m.insert ( SoundType, QString::number( (int)alarmSound() ) ); | 440 | m.insert ( SoundType, QString::number( (int)alarmSound() ) ); |
441 | m.insert ( AlarmTime, QString::number( alarmTime() ) ); | 441 | m.insert ( AlarmTime, QString::number( alarmTime() ) ); |
442 | m.insert ( RepeatPatternType, QString::number( static_cast<int>( repeatPattern().type ) ) ); | 442 | m.insert ( RepeatPatternType, QString::number( static_cast<int>( repeatPattern().type ) ) ); |
443 | m.insert ( RepeatPatternFrequency, QString::number( repeatPattern().frequency ) ); | 443 | m.insert ( RepeatPatternFrequency, QString::number( repeatPattern().frequency ) ); |
444 | m.insert ( RepeatPatternPosition, QString::number( repeatPattern().position ) ); | 444 | m.insert ( RepeatPatternPosition, QString::number( repeatPattern().position ) ); |
445 | m.insert ( RepeatPatternDays, QString::number( repeatPattern().days ) ); | 445 | m.insert ( RepeatPatternDays, QString::number( repeatPattern().days ) ); |
446 | m.insert ( RepeatPatternHasEndDate, QString::number( static_cast<int>( repeatPattern().hasEndDate ) ) ); | 446 | m.insert ( RepeatPatternHasEndDate, QString::number( static_cast<int>( repeatPattern().hasEndDate ) ) ); |
447 | m.insert ( RepeatPatternEndDate, QString::number( repeatPattern().endDateUTC ) ); | 447 | m.insert ( RepeatPatternEndDate, QString::number( repeatPattern().endDateUTC ) ); |
448 | 448 | ||
449 | m.insert( DatebookUid, QString::number( uid()) ); | 449 | m.insert( DatebookUid, QString::number( uid()) ); |
450 | 450 | ||
451 | return m; | 451 | return m; |
452 | } | 452 | } |
453 | 453 | ||
454 | /*! | 454 | /*! |
455 | \internal | 455 | \internal |
456 | */ | 456 | */ |
457 | void Event::setRepeat( const RepeatPattern &p ) | 457 | void Event::setRepeat( const RepeatPattern &p ) |
458 | { | 458 | { |
459 | setRepeat( p.type != NoRepeat, p ); | 459 | setRepeat( p.type != NoRepeat, p ); |
460 | } | 460 | } |
461 | 461 | ||
462 | /*! | 462 | /*! |
463 | Sets the description of the event to \a s. | 463 | Sets the description of the event to \a s. |
464 | */ | 464 | */ |
465 | void Event::setDescription( const QString &s ) | 465 | void Event::setDescription( const QString &s ) |
466 | { | 466 | { |
467 | descript = s; | 467 | descript = s; |
468 | } | 468 | } |
469 | 469 | ||
470 | /*! | 470 | /*! |
471 | Sets the location of the event to \a s. | 471 | Sets the location of the event to \a s. |
472 | */ | 472 | */ |
473 | void Event::setLocation( const QString &s ) | 473 | void Event::setLocation( const QString &s ) |
474 | { | 474 | { |
475 | locat = s; | 475 | locat = s; |
476 | } | 476 | } |
477 | 477 | ||
478 | // void Event::setCategory( const QString &s ) | 478 | // void Event::setCategory( const QString &s ) |
479 | // { | 479 | // { |
480 | // categ = s; | 480 | // categ = s; |
481 | // } | 481 | // } |
482 | 482 | ||
483 | /*! | 483 | /*! |
484 | \internal | 484 | \internal |
485 | */ | 485 | */ |
486 | void Event::setType( Type t ) | 486 | void Event::setType( Type t ) |
487 | { | 487 | { |
488 | typ = t; | 488 | typ = t; |
489 | } | 489 | } |
490 | 490 | ||
491 | /*! | 491 | /*! |
492 | Sets the start date and time of the first or only occurance of this event | 492 | Sets the start date and time of the first or only occurance of this event |
493 | to the date and time \a d. \a d should be in local time. | 493 | to the date and time \a d. \a d should be in local time. |
494 | */ | 494 | */ |
495 | void Event::setStart( const QDateTime &d ) | 495 | void Event::setStart( const QDateTime &d ) |
496 | { | 496 | { |
497 | startUTC = TimeConversion::toUTC( d ); | 497 | startUTC = TimeConversion::toUTC( d ); |
498 | } | 498 | } |
499 | 499 | ||
500 | /*! | 500 | /*! |
501 | \internal | 501 | \internal |
502 | */ | 502 | */ |
503 | void Event::setStart( time_t time ) | 503 | void Event::setStart( time_t time ) |
504 | { | 504 | { |
505 | startUTC = time; | 505 | startUTC = time; |
506 | } | 506 | } |
507 | 507 | ||
508 | /*! | 508 | /*! |
509 | Sets the end date and time of the first or only occurance of this event | 509 | Sets the end date and time of the first or only occurance of this event |
510 | to the date and time \a d. \a d should be in local time. | 510 | to the date and time \a d. \a d should be in local time. |
511 | */ | 511 | */ |
512 | void Event::setEnd( const QDateTime &d ) | 512 | void Event::setEnd( const QDateTime &d ) |
513 | { | 513 | { |
514 | endUTC = TimeConversion::toUTC( d ); | 514 | endUTC = TimeConversion::toUTC( d ); |
515 | } | 515 | } |
516 | 516 | ||
517 | /*! | 517 | /*! |
518 | \internal | 518 | \internal |
519 | */ | 519 | */ |
520 | void Event::setEnd( time_t time ) | 520 | void Event::setEnd( time_t time ) |
521 | { | 521 | { |
522 | endUTC = time; | 522 | endUTC = time; |
523 | } | 523 | } |
524 | 524 | ||
525 | /*! | 525 | /*! |
526 | \internal | 526 | \internal |
527 | */ | 527 | */ |
528 | void Event::setTimeZone( const QString &z ) | 528 | void Event::setTimeZone( const QString &z ) |
529 | { | 529 | { |
530 | tz = z; | 530 | tz = z; |
531 | } | 531 | } |
532 | 532 | ||
533 | /*! | 533 | /*! |
534 | \internal | 534 | \internal |
535 | */ | 535 | */ |
536 | void Event::setAlarm( bool b, int minutes, SoundTypeChoice s ) | 536 | void Event::setAlarm( bool b, int minutes, SoundTypeChoice s ) |
537 | { | 537 | { |
538 | hAlarm = b; | 538 | hAlarm = b; |
539 | aMinutes = minutes; | 539 | aMinutes = minutes; |
540 | aSound = s; | 540 | aSound = s; |
541 | } | 541 | } |
542 | 542 | ||
543 | /*! | 543 | /*! |
544 | \internal | 544 | \internal |
545 | */ | 545 | */ |
546 | void Event::setRepeat( bool b, const RepeatPattern &p ) | 546 | void Event::setRepeat( bool b, const RepeatPattern &p ) |
547 | { | 547 | { |
548 | hRepeat = b; | 548 | hRepeat = b; |
549 | pattern = p; | 549 | pattern = p; |
550 | } | 550 | } |
551 | 551 | ||
552 | /*! | 552 | /*! |
553 | Sets the notes for the event to \a n. | 553 | Sets the notes for the event to \a n. |
554 | */ | 554 | */ |
555 | void Event::setNotes( const QString &n ) | 555 | void Event::setNotes( const QString &n ) |
556 | { | 556 | { |
557 | note = n; | 557 | note = n; |
558 | } | 558 | } |
559 | 559 | ||
560 | /*! | 560 | /*! |
561 | Returns the description of the event. | 561 | Returns the description of the event. |
562 | */ | 562 | */ |
563 | const QString &Event::description() const | 563 | const QString &Event::description() const |
564 | { | 564 | { |
565 | return descript; | 565 | return descript; |
566 | } | 566 | } |
567 | 567 | ||
568 | /*! | 568 | /*! |
569 | Returns the location of the event. | 569 | Returns the location of the event. |
570 | */ | 570 | */ |
571 | const QString &Event::location() const | 571 | const QString &Event::location() const |
572 | { | 572 | { |
573 | return locat; | 573 | return locat; |
574 | } | 574 | } |
575 | 575 | ||
576 | // QString Event::category() const | 576 | // QString Event::category() const |
577 | // { | 577 | // { |
578 | // return categ; | 578 | // return categ; |
579 | // } | 579 | // } |
580 | 580 | ||
581 | /*! | 581 | /*! |
582 | \internal | 582 | \internal |
583 | */ | 583 | */ |
584 | Event::Type Event::type() const | 584 | Event::Type Event::type() const |
585 | { | 585 | { |
586 | return typ; | 586 | return typ; |
587 | } | 587 | } |
588 | /* | 588 | /* |
589 | QDateTime Event::start() const { | 589 | QDateTime Event::start() const { |
590 | return start( TRUE ); | 590 | return start( TRUE ); |
591 | } | 591 | } |
592 | */ | 592 | */ |
593 | /*! | 593 | /*! |
594 | \internal | 594 | \internal |
595 | */ | 595 | */ |
596 | QDateTime Event::start( bool actual ) const | 596 | QDateTime Event::start( bool actual ) const |
597 | { | 597 | { |
598 | QDateTime dt = TimeConversion::fromUTC( startUTC ); | 598 | QDateTime dt = TimeConversion::fromUTC( startUTC ); |
599 | 599 | ||
600 | if ( actual && typ == AllDay ) { | 600 | if ( actual && typ == AllDay ) { |
601 | QTime t = dt.time(); | 601 | QTime t = dt.time(); |
602 | t.setHMS( 0, 0, 0 ); | 602 | t.setHMS( 0, 0, 0 ); |
603 | dt.setTime( t ); | 603 | dt.setTime( t ); |
604 | } | 604 | } |
605 | return dt; | 605 | return dt; |
606 | } | 606 | } |
607 | /* | 607 | /* |
608 | QDateTime Event::end() const { | 608 | QDateTime Event::end() const { |
609 | return end( TRUE ); | 609 | return end( TRUE ); |
610 | } | 610 | } |
611 | */ | 611 | */ |
612 | /*! | 612 | /*! |
613 | \internal | 613 | \internal |
614 | */ | 614 | */ |
615 | QDateTime Event::end( bool actual ) const | 615 | QDateTime Event::end( bool actual ) const |
616 | { | 616 | { |
617 | QDateTime dt = TimeConversion::fromUTC( endUTC ); | 617 | QDateTime dt = TimeConversion::fromUTC( endUTC ); |
618 | if ( actual && typ == AllDay ) { | 618 | if ( actual && typ == AllDay ) { |
619 | dt.setTime( QTime(23,59,59) ); | 619 | dt.setTime( QTime(23,59,59) ); |
620 | } | 620 | } |
621 | return dt; | 621 | return dt; |
622 | } | 622 | } |
623 | 623 | ||
624 | /*! | 624 | /*! |
625 | \internal | 625 | \internal |
626 | */ | 626 | */ |
627 | const QString &Event::timeZone() const | 627 | const QString &Event::timeZone() const |
628 | { | 628 | { |
629 | return tz; | 629 | return tz; |
630 | } | 630 | } |
631 | 631 | ||
632 | /*! | 632 | /*! |
633 | \internal | 633 | \internal |
634 | */ | 634 | */ |
635 | bool Event::hasAlarm() const | 635 | bool Event::hasAlarm() const |
636 | { | 636 | { |
637 | return hAlarm; | 637 | return hAlarm; |
638 | } | 638 | } |
639 | 639 | ||
640 | /*! | 640 | /*! |
641 | \internal | 641 | \internal |
642 | */ | 642 | */ |
643 | int Event::alarmTime() const | 643 | int Event::alarmTime() const |
644 | { | 644 | { |
645 | return aMinutes; | 645 | return aMinutes; |
646 | } | 646 | } |
647 | 647 | ||
648 | /*! | 648 | /*! |
649 | Returns the sound type for the alarm of this event. | 649 | Returns the sound type for the alarm of this event. |
650 | */ | 650 | */ |
651 | Event::SoundTypeChoice Event::alarmSound() const | 651 | Event::SoundTypeChoice Event::alarmSound() const |
652 | { | 652 | { |
653 | return aSound; | 653 | return aSound; |
654 | } | 654 | } |
655 | 655 | ||
656 | /*! | 656 | /*! |
657 | \internal | 657 | \internal |
658 | */ | 658 | */ |