summaryrefslogtreecommitdiff
path: root/libopie/pim/ocontact.cpp
Unidiff
Diffstat (limited to 'libopie/pim/ocontact.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontact.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp
index a2fb68c..be4ce0a 100644
--- a/libopie/pim/ocontact.cpp
+++ b/libopie/pim/ocontact.cpp
@@ -420,49 +420,49 @@ OContact::~OContact()
420 \internal 420 \internal
421*/ 421*/
422QMap<int, QString> OContact::toMap() const 422QMap<int, QString> OContact::toMap() const
423{ 423{
424 QMap<int, QString> map = mMap; 424 QMap<int, QString> map = mMap;
425 QString cats = idsToString( categories() ); 425 QString cats = idsToString( categories() );
426 if ( !cats.isEmpty() ) 426 if ( !cats.isEmpty() )
427 map.insert( Qtopia::AddressCategory, cats ); 427 map.insert( Qtopia::AddressCategory, cats );
428 return map; 428 return map;
429} 429}
430 430
431/*! 431/*!
432 Returns a rich text formatted QString representing the contents the contact. 432 Returns a rich text formatted QString representing the contents the contact.
433*/ 433*/
434QString OContact::toRichText() const 434QString OContact::toRichText() const
435{ 435{
436 QString text; 436 QString text;
437 QString value, comp, state; 437 QString value, comp, state;
438 QString str; 438 QString str;
439 bool marker = false; 439 bool marker = false;
440 440
441 // name, jobtitle and company 441 // name, jobtitle and company
442 if ( !(value = fullName()).isEmpty() ) 442 if ( !(value = fullName()).isEmpty() )
443 text += "<b><h3><img src=\"addressbook/AddressBook\">" + Qtopia::escapeString(value) + "</h3></b>"; 443 text += "<b><h3><img src=\"addressbook/AddressBook\">" + Qtopia::escapeString(value) + "</h3></b>";
444 444
445 if ( !(value = jobTitle()).isEmpty() ) 445 if ( !(value = jobTitle()).isEmpty() )
446 text += Qtopia::escapeString(value) + "<br>"; 446 text += Qtopia::escapeString(value) + "<br>";
447 447
448 comp = company(); 448 comp = company();
449 if ( !(value = department()).isEmpty() ) { 449 if ( !(value = department()).isEmpty() ) {
450 text += Qtopia::escapeString(value); 450 text += Qtopia::escapeString(value);
451 if ( comp ) 451 if ( comp )
452 text += ", "; 452 text += ", ";
453 else 453 else
454 text += "<br>"; 454 text += "<br>";
455 } 455 }
456 if ( !comp.isEmpty() ) 456 if ( !comp.isEmpty() )
457 text += Qtopia::escapeString(comp) + "<br>"; 457 text += Qtopia::escapeString(comp) + "<br>";
458 458
459 text += "<hr><br>"; 459 text += "<hr><br>";
460 460
461 // defailt email 461 // defailt email
462 QString defEmail = defaultEmail(); 462 QString defEmail = defaultEmail();
463 if ( !defEmail.isEmpty() ) 463 if ( !defEmail.isEmpty() )
464 text += "<b><img src=\"addressbook/email\">" + QObject::tr("Default Email: ") + "</b>" 464 text += "<b><img src=\"addressbook/email\">" + QObject::tr("Default Email: ") + "</b>"
465 + Qtopia::escapeString(defEmail) + "<br>"; 465 + Qtopia::escapeString(defEmail) + "<br>";
466 466
467 text += "<br>"; 467 text += "<br>";
468 468
@@ -961,55 +961,49 @@ bool OContact::match( const QRegExp &r ) const
961 setLastHitField( -1 ); 961 setLastHitField( -1 );
962 bool match; 962 bool match;
963 match = false; 963 match = false;
964 QMap<int, QString>::ConstIterator it; 964 QMap<int, QString>::ConstIterator it;
965 for ( it = mMap.begin(); it != mMap.end(); ++it ) { 965 for ( it = mMap.begin(); it != mMap.end(); ++it ) {
966 if ( (*it).find( r ) > -1 ) { 966 if ( (*it).find( r ) > -1 ) {
967 setLastHitField( it.key() ); 967 setLastHitField( it.key() );
968 match = true; 968 match = true;
969 break; 969 break;
970 } 970 }
971 } 971 }
972 return match; 972 return match;
973} 973}
974 974
975 975
976QString OContact::toShortText() const 976QString OContact::toShortText() const
977{ 977{
978 return ( fullName() ); 978 return ( fullName() );
979} 979}
980QString OContact::type() const 980QString OContact::type() const
981{ 981{
982 return QString::fromLatin1( "OContact" ); 982 return QString::fromLatin1( "OContact" );
983} 983}
984 984
985// Definition is missing ! (se) 985
986QMap<QString,QString> OContact::toExtraMap() const
987{
988 qWarning ("Function not implemented: OContact::toExtraMap()");
989 QMap <QString,QString> useless;
990 return useless;
991}
992 986
993class QString OContact::recordField( int pos ) const 987class QString OContact::recordField( int pos ) const
994{ 988{
995 QStringList SLFIELDS = fields(); // ?? why this ? (se) 989 QStringList SLFIELDS = fields(); // ?? why this ? (se)
996 return SLFIELDS[pos]; 990 return SLFIELDS[pos];
997} 991}
998 992
999// In future releases, we should store birthday and anniversary 993// In future releases, we should store birthday and anniversary
1000// internally as QDate instead of QString ! 994// internally as QDate instead of QString !
1001// QString is always too complicate to interprete (DD.MM.YY, DD/MM/YY, MM/DD/YY, etc..)(se) 995// QString is always too complicate to interprete (DD.MM.YY, DD/MM/YY, MM/DD/YY, etc..)(se)
1002 996
1003/*! \fn void OContact::setBirthday( const QDate& date ) 997/*! \fn void OContact::setBirthday( const QDate& date )
1004 Sets the birthday for the contact to \a date. If date is null 998 Sets the birthday for the contact to \a date. If date is null
1005 the current stored date will be removed. 999 the current stored date will be removed.
1006*/ 1000*/
1007void OContact::setBirthday( const QDate &v ) 1001void OContact::setBirthday( const QDate &v )
1008{ 1002{
1009 if ( v.isNull() ){ 1003 if ( v.isNull() ){
1010 qWarning( "Remove Birthday"); 1004 qWarning( "Remove Birthday");
1011 replace( Qtopia::Birthday, QString::null ); 1005 replace( Qtopia::Birthday, QString::null );
1012 return; 1006 return;
1013 } 1007 }
1014 1008
1015 if ( v.isValid() ) 1009 if ( v.isValid() )