Diffstat (limited to 'libopie2/opiepim/core/opimcontact.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimcontact.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/libopie2/opiepim/core/opimcontact.cpp b/libopie2/opiepim/core/opimcontact.cpp index 36e9a93..64f195b 100644 --- a/libopie2/opiepim/core/opimcontact.cpp +++ b/libopie2/opiepim/core/opimcontact.cpp @@ -83,3 +83,2 @@ OPimContact::OPimContact( const QMap<int, QString> &fromMap ):OPimRecord(), mMap { - owarn << "Invalid UID found. Generate new one.." << oendl; setUid( uidGen().generate() ); @@ -1140,3 +1139,2 @@ void OPimContact::setBirthday( const QDate &v ) { - owarn << "Remove Birthday" << oendl; replace( Qtopia::Birthday, QString::null ); @@ -1159,3 +1157,2 @@ void OPimContact::setAnniversary( const QDate &v ) { - owarn << "Remove Anniversary" << oendl; replace( Qtopia::Anniversary, QString::null ); @@ -1175,3 +1172,2 @@ QDate OPimContact::birthday() const QString str = find( Qtopia::Birthday ); - // owarn << "Birthday " << str << oendl; if ( !str.isEmpty() ) @@ -1190,3 +1186,2 @@ QDate OPimContact::anniversary() const QString str = find( Qtopia::Anniversary ); - // owarn << "Anniversary " << str << oendl; if ( !str.isEmpty() ) @@ -1284,2 +1279,21 @@ int OPimContact::rtti() const +/** + * \brief Cast to OPimContact or on failure return 0l + * + * This method tries to cast from a OPimRecord to a + * OPimContact it uses. If the OPimRecord is from type + * OPimContact the case will suceed and a pointer to + * OPimContact is returned otherwise a Null Pointer is returned. + * + * + * @see OPimTodo::safeCast() + * @see OPimEvent::safeCast() + * @return Return a OPimContact or a Null Pointer + */ +OPimContact* OPimContact::safeCast( const OPimRecord* rec ) { + return( rec && rec->rtti() == OPimResolver::AddressBook ) ? + static_cast<OPimContact*>( const_cast<OPimRecord*>(rec) ) : + 0l; +} + |