summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimcontact.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimcontact.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimcontact.cpp24
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
@@ -81,7 +81,6 @@ OPimContact::OPimContact( const QMap<int, QString> &fromMap ):OPimRecord(), mMap
81 81
82 if ( uidStr.isEmpty() || ( uidStr.toInt() == 0 ) ) 82 if ( uidStr.isEmpty() || ( uidStr.toInt() == 0 ) )
83 { 83 {
84 owarn << "Invalid UID found. Generate new one.." << oendl;
85 setUid( uidGen().generate() ); 84 setUid( uidGen().generate() );
86 } 85 }
87 else 86 else
@@ -1138,7 +1137,6 @@ void OPimContact::setBirthday( const QDate &v )
1138{ 1137{
1139 if ( v.isNull() ) 1138 if ( v.isNull() )
1140 { 1139 {
1141 owarn << "Remove Birthday" << oendl;
1142 replace( Qtopia::Birthday, QString::null ); 1140 replace( Qtopia::Birthday, QString::null );
1143 return ; 1141 return ;
1144 } 1142 }
@@ -1157,7 +1155,6 @@ void OPimContact::setAnniversary( const QDate &v )
1157{ 1155{
1158 if ( v.isNull() ) 1156 if ( v.isNull() )
1159 { 1157 {
1160 owarn << "Remove Anniversary" << oendl;
1161 replace( Qtopia::Anniversary, QString::null ); 1158 replace( Qtopia::Anniversary, QString::null );
1162 return ; 1159 return ;
1163 } 1160 }
@@ -1173,7 +1170,6 @@ void OPimContact::setAnniversary( const QDate &v )
1173QDate OPimContact::birthday() const 1170QDate OPimContact::birthday() const
1174{ 1171{
1175 QString str = find( Qtopia::Birthday ); 1172 QString str = find( Qtopia::Birthday );
1176 // owarn << "Birthday " << str << oendl;
1177 if ( !str.isEmpty() ) 1173 if ( !str.isEmpty() )
1178 return OPimDateConversion::dateFromString ( str ); 1174 return OPimDateConversion::dateFromString ( str );
1179 else 1175 else
@@ -1188,7 +1184,6 @@ QDate OPimContact::anniversary() const
1188{ 1184{
1189 QDate empty; 1185 QDate empty;
1190 QString str = find( Qtopia::Anniversary ); 1186 QString str = find( Qtopia::Anniversary );
1191 // owarn << "Anniversary " << str << oendl;
1192 if ( !str.isEmpty() ) 1187 if ( !str.isEmpty() )
1193 return OPimDateConversion::dateFromString ( str ); 1188 return OPimDateConversion::dateFromString ( str );
1194 else 1189 else
@@ -1282,6 +1277,25 @@ int OPimContact::rtti() const
1282 return OPimResolver::AddressBook; 1277 return OPimResolver::AddressBook;
1283} 1278}
1284 1279
1280/**
1281 * \brief Cast to OPimContact or on failure return 0l
1282 *
1283 * This method tries to cast from a OPimRecord to a
1284 * OPimContact it uses. If the OPimRecord is from type
1285 * OPimContact the case will suceed and a pointer to
1286 * OPimContact is returned otherwise a Null Pointer is returned.
1287 *
1288 *
1289 * @see OPimTodo::safeCast()
1290 * @see OPimEvent::safeCast()
1291 * @return Return a OPimContact or a Null Pointer
1292 */
1293OPimContact* OPimContact::safeCast( const OPimRecord* rec ) {
1294 return( rec && rec->rtti() == OPimResolver::AddressBook ) ?
1295 static_cast<OPimContact*>( const_cast<OPimRecord*>(rec) ) :
1296 0l;
1297}
1298
1285 1299
1286void OPimContact::setUid( int i ) 1300void OPimContact::setUid( int i )
1287{ 1301{