Diffstat (limited to 'libopie2/opiepim/core/opimevent.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimevent.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/opimevent.cpp b/libopie2/opiepim/core/opimevent.cpp index 7bc6c32..1b553d8 100644 --- a/libopie2/opiepim/core/opimevent.cpp +++ b/libopie2/opiepim/core/opimevent.cpp | |||
@@ -486,12 +486,31 @@ QString OPimEvent::recordField( int /*id */ ) const | |||
486 | 486 | ||
487 | int OPimEvent::rtti() const | 487 | int OPimEvent::rtti() const |
488 | { | 488 | { |
489 | return OPimResolver::DateBook; | 489 | return OPimResolver::DateBook; |
490 | } | 490 | } |
491 | 491 | ||
492 | /** | ||
493 | * \brief Cast safely to OPimEvent from OPimRecord | ||
494 | * | ||
495 | * Safely cast from OPimRecord to OPimEvent. If the | ||
496 | * OPimRecord is not of type OPimEvent Null will be | ||
497 | * returned. | ||
498 | * | ||
499 | * @param rec The OPimRecord to be casted to OPimEvent | ||
500 | * | ||
501 | * @see OPimTodo::safeCast | ||
502 | * @return OPimEvent or Null Pointer | ||
503 | */ | ||
504 | OPimEvent* OPimEvent::safeCast( const OPimRecord* rec) { | ||
505 | return ( rec && rec->rtti() == OPimResolver::DateBook ) ? | ||
506 | static_cast<OPimEvent*>( const_cast<OPimRecord*>(rec) ) : | ||
507 | 0l; | ||
508 | } | ||
509 | |||
510 | |||
492 | 511 | ||
493 | bool OPimEvent::loadFromStream( QDataStream& ) | 512 | bool OPimEvent::loadFromStream( QDataStream& ) |
494 | { | 513 | { |
495 | return true; | 514 | return true; |
496 | } | 515 | } |
497 | 516 | ||