-rw-r--r-- | library/backend/event.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/library/backend/event.cpp b/library/backend/event.cpp index 7110717..8f3f780 100644 --- a/library/backend/event.cpp +++ b/library/backend/event.cpp | |||
@@ -415,25 +415,25 @@ int Event::monthDiff( const QDate& first, const QDate& second ) | |||
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" ) ); |
@@ -576,40 +576,45 @@ const QString &Event::location() const | |||
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 | QDateTime Event::start() const { | |
589 | return start( TRUE ); | ||
590 | } | ||
589 | /*! | 591 | /*! |
590 | \internal | 592 | \internal |
591 | */ | 593 | */ |
592 | QDateTime Event::start( bool actual ) const | 594 | QDateTime Event::start( bool actual ) const |
593 | { | 595 | { |
594 | QDateTime dt = (startUTC > 0) ? TimeConversion::fromUTC( startUTC ) : QDateTime::currentDateTime(); | 596 | QDateTime dt = (startUTC > 0) ? TimeConversion::fromUTC( startUTC ) : QDateTime::currentDateTime(); |
595 | 597 | ||
596 | if ( actual && typ == AllDay ) { | 598 | if ( actual && typ == AllDay ) { |
597 | QTime t = dt.time(); | 599 | QTime t = dt.time(); |
598 | t.setHMS( 0, 0, 0 ); | 600 | t.setHMS( 0, 0, 0 ); |
599 | dt.setTime( t ); | 601 | dt.setTime( t ); |
600 | } | 602 | } |
601 | return dt; | 603 | return dt; |
602 | } | 604 | } |
603 | 605 | ||
606 | QDateTime Event::end() const { | ||
607 | return end( TRUE ); | ||
608 | } | ||
604 | /*! | 609 | /*! |
605 | \internal | 610 | \internal |
606 | */ | 611 | */ |
607 | QDateTime Event::end( bool actual ) const | 612 | QDateTime Event::end( bool actual ) const |
608 | { | 613 | { |
609 | QDateTime dt = (endUTC > 0) ? TimeConversion::fromUTC( endUTC ) : QDateTime::currentDateTime(); | 614 | QDateTime dt = (endUTC > 0) ? TimeConversion::fromUTC( endUTC ) : QDateTime::currentDateTime(); |
610 | 615 | ||
611 | if ( actual && typ == AllDay ) { | 616 | if ( actual && typ == AllDay ) { |
612 | QTime t = dt.time(); | 617 | QTime t = dt.time(); |
613 | t.setHMS( 23, 59, 59 ); | 618 | t.setHMS( 23, 59, 59 ); |
614 | dt.setTime( t ); | 619 | dt.setTime( t ); |
615 | } | 620 | } |