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 | |||
@@ -490,4 +490,23 @@ int OPimEvent::rtti() const | |||
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& ) |