author | eilers <eilers> | 2002-11-01 09:03:40 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-11-01 09:03:40 (UTC) |
commit | db5e359a4477b61d49328ee9d060e92bf1098980 (patch) (side-by-side diff) | |
tree | 1a6e5face7043a1d2798b9fa8f6b7a8479a2af12 | |
parent | 9764202a3e4d35d8b2a0b6330ecfad5a29d56e01 (diff) | |
download | opie-db5e359a4477b61d49328ee9d060e92bf1098980.zip opie-db5e359a4477b61d49328ee9d060e92bf1098980.tar.gz opie-db5e359a4477b61d49328ee9d060e92bf1098980.tar.bz2 |
Bugfix #383 && #356
-rw-r--r-- | libopie/pim/ocontact.cpp | 33 | ||||
-rw-r--r-- | libopie2/opiepim/ocontact.cpp | 33 |
2 files changed, 38 insertions, 28 deletions
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp index bf27d0f..acd65c4 100644 --- a/libopie/pim/ocontact.cpp +++ b/libopie/pim/ocontact.cpp @@ -40,73 +40,75 @@ /*! \class Contact contact.h \brief The Contact class holds the data of an address book entry. This data includes information the name of the person, contact information, and business information such as deparment and job title. \ingroup qtopiaemb \ingroup qtopiadesktop */ Qtopia::UidGen OContact::sUidGen( Qtopia::UidGen::Qtopia ); /*! Creates a new, empty contact. */ OContact::OContact() : OPimRecord(), mMap(), d( 0 ) { } /*! \internal Creates a new contact. The properties of the contact are set from \a fromMap. */ OContact::OContact( const QMap<int, QString> &fromMap ) : OPimRecord(), mMap( fromMap ), d( 0 ) { QString cats = mMap[ Qtopia::AddressCategory ]; if ( !cats.isEmpty() ) setCategories( idsFromString( cats ) ); + QString uidStr = find( Qtopia::AddressUid ); - if ( uidStr.isEmpty() ) + if ( uidStr.isEmpty() || (uidStr.toInt() == 0) ){ + qWarning( "Invalid UID found. Generate new one.." ); setUid( uidGen().generate() ); - else + }else setUid( uidStr.toInt() ); - if ( !uidStr.isEmpty() ) - setUid( uidStr.toInt() ); +// if ( !uidStr.isEmpty() ) +// setUid( uidStr.toInt() ); } /*! Destroys a contact. */ OContact::~OContact() { } /*! \fn void OContact::setTitle( const QString &str ) Sets the title of the contact to \a str. */ /*! \fn void OContact::setFirstName( const QString &str ) Sets the first name of the contact to \a str. */ /*! \fn void OContact::setMiddleName( const QString &str ) Sets the middle name of the contact to \a str. */ /*! \fn void OContact::setLastName( const QString &str ) Sets the last name of the contact to \a str. */ /*! \fn void OContact::setSuffix( const QString &str ) Sets the suffix of the contact to \a str. */ /*! \fn void OContact::setFileAs( const QString &str ) Sets the contact to filed as \a str. */ @@ -542,70 +544,70 @@ QString OContact::toRichText() const str = businessMobile(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Business Mobile: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = businessPager(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Business Pager: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = profession(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Profession: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = assistant(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Assistant: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = manager(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Manager: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = gender(); if ( !str.isEmpty() && str.toInt() != 0 ) { if ( str.toInt() == 1 ) str = QObject::tr( "Male" ); else if ( str.toInt() == 2 ) str = QObject::tr( "Female" ); text += "<b>" + QObject::tr("Gender: ") + "</b>" + str + "<br>"; } str = spouse(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Spouse: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; - if ( !birthday().isValid() ){ + if ( birthday().isValid() ){ str = TimeString::numberDateString( birthday() ); text += "<b>" + QObject::tr("Birthday: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; } - if ( !anniversary().isValid() ){ + if ( anniversary().isValid() ){ str = TimeString::numberDateString( anniversary() ); text += "<b>" + QObject::tr("Anniversary: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; } str = nickname(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Nickname: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; // notes last if ( (value = notes()) ) { QRegExp reg("\n"); //QString tmp = Qtopia::escapeString(value); QString tmp = QStyleSheet::convertFromPlainText(value); //tmp.replace( reg, "<br>" ); text += "<br>" + tmp + "<br>"; } return text; } /*! \internal */ void OContact::insert( int key, const QString &v ) { QString value = v.stripWhiteSpace(); if ( value.isEmpty() ) mMap.remove( key ); else mMap.insert( key, value ); } @@ -1094,115 +1096,119 @@ static VObject *createVObject( const OContact &c ) safeAddPropValue( work_adr, VCPostalCodeProp, c.businessZip() ); safeAddPropValue( work_adr, VCCountryNameProp, c.businessCountry() ); VObject *work_phone = safeAddPropValue( vcard, VCTelephoneProp, c.businessPhone() ); safeAddProp( work_phone, VCWorkProp ); work_phone = safeAddPropValue( vcard, VCTelephoneProp, c.businessMobile() ); safeAddProp( work_phone, VCWorkProp ); safeAddProp( work_phone, VCCellularProp ); work_phone = safeAddPropValue( vcard, VCTelephoneProp, c.businessFax() ); safeAddProp( work_phone, VCWorkProp ); safeAddProp( work_phone, VCFaxProp ); work_phone = safeAddPropValue( vcard, VCTelephoneProp, c.businessPager() ); safeAddProp( work_phone, VCWorkProp ); safeAddProp( work_phone, VCPagerProp ); url = safeAddPropValue( vcard, VCURLProp, c.businessWebpage() ); safeAddProp( url, VCWorkProp ); VObject *title = safeAddPropValue( vcard, VCTitleProp, c.jobTitle() ); safeAddProp( title, VCWorkProp ); QStringList emails = c.emailList(); emails.prepend( c.defaultEmail() ); for( QStringList::Iterator it = emails.begin(); it != emails.end(); ++it ) { VObject *email = safeAddPropValue( vcard, VCEmailAddressProp, *it ); safeAddProp( email, VCInternetProp ); } safeAddPropValue( vcard, VCNoteProp, c.notes() ); // Exporting Birthday regarding RFC 2425 (5.8.4) - if ( !c.birthday().isValid() ){ + if ( c.birthday().isValid() ){ QString birthd_rfc2425 = QString("%1-%2-%3") .arg( c.birthday().year() ) .arg( c.birthday().month(), 2 ) .arg( c.birthday().day(), 2 ); // Now replace spaces with "0"... int pos = 0; while ( ( pos = birthd_rfc2425.find (' ') ) > 0 ) birthd_rfc2425.replace( pos, 1, "0" ); qWarning("Exporting birthday as: %s", birthd_rfc2425.latin1()); safeAddPropValue( vcard, VCBirthDateProp, birthd_rfc2425.latin1() ); } if ( !c.company().isEmpty() || !c.department().isEmpty() || !c.office().isEmpty() ) { VObject *org = safeAddProp( vcard, VCOrgProp ); safeAddPropValue( org, VCOrgNameProp, c.company() ); safeAddPropValue( org, VCOrgUnitProp, c.department() ); safeAddPropValue( org, VCOrgUnit2Prop, c.office() ); } // some values we have to export as custom fields safeAddPropValue( vcard, "X-Qtopia-Profession", c.profession() ); safeAddPropValue( vcard, "X-Qtopia-Manager", c.manager() ); safeAddPropValue( vcard, "X-Qtopia-Assistant", c.assistant() ); safeAddPropValue( vcard, "X-Qtopia-Spouse", c.spouse() ); safeAddPropValue( vcard, "X-Qtopia-Gender", c.gender() ); safeAddPropValue( vcard, "X-Qtopia-Anniversary", TimeConversion::toString( c.anniversary() ) ); safeAddPropValue( vcard, "X-Qtopia-Nickname", c.nickname() ); safeAddPropValue( vcard, "X-Qtopia-Children", c.children() ); return vcard; } /*! \internal */ static QDate convVCardDateToDate( const QString& datestr ) { int monthPos = datestr.find('-'); int dayPos = datestr.find('-', monthPos+1 ); int sep_ignore = 1; if ( monthPos == -1 || dayPos == -1 ) { qDebug("fromString didn't find - in str = %s; mpos = %d ypos = %d", datestr.latin1(), monthPos, dayPos ); - // Ok.. Outlook is violating ISO 8601, therefore we will try to read their format ( YYYYMMDD ) - monthPos = 4; - dayPos = 6; - sep_ignore = 0; - qDebug("Try with follwing positions str = %s; mpos = %d ypos = %d", datestr.latin1(), monthPos, dayPos ); + // Ok.. No "-" found, therefore we will try to read other format ( YYYYMMDD ) + if ( datestr.length() == 8 ){ + monthPos = 4; + dayPos = 6; + sep_ignore = 0; + qDebug("Try with follwing positions str = %s; mpos = %d ypos = %d", datestr.latin1(), monthPos, dayPos ); + } else { + return QDate(); + } } int y = datestr.left( monthPos ).toInt(); int m = datestr.mid( monthPos + sep_ignore, dayPos - monthPos - sep_ignore ).toInt(); int d = datestr.mid( dayPos + sep_ignore ).toInt(); qDebug("TimeConversion::fromString ymd = %s => %d %d %d; mpos = %d ypos = %d", datestr.latin1(), y, m, d, monthPos, dayPos); QDate date ( y,m,d ); return date; } static OContact parseVObject( VObject *obj ) { OContact c; VObjectIterator it; initPropIterator( &it, obj ); while( moreIteration( &it ) ) { VObject *o = nextVObject( &it ); QCString name = vObjectName( o ); QCString value = vObjectStringZValue( o ); if ( name == VCNameProp ) { VObjectIterator nit; initPropIterator( &nit, o ); while( moreIteration( &nit ) ) { VObject *o = nextVObject( &nit ); QCString name = vObjectTypeInfo( o ); QString value = vObjectStringZValue( o ); if ( name == VCNamePrefixesProp ) c.setTitle( value ); else if ( name == VCNameSuffixesProp ) c.setSuffix( value ); else if ( name == VCFamilyNameProp ) c.setLastName( value ); @@ -1520,71 +1526,70 @@ class QString OContact::recordField( int pos ) const return SLFIELDS[pos]; } // In future releases, we should store birthday and anniversary // internally as QDate instead of QString ! // QString is always too complicate to interprete (DD.MM.YY, DD/MM/YY, MM/DD/YY, etc..)(se) /*! \fn void OContact::setBirthday( const QDate& date ) Sets the birthday for the contact to \a date. */ void OContact::setBirthday( const QDate &v ) { if ( ( !v.isNull() ) && ( v.isValid() ) ) replace( Qtopia::Birthday, TimeConversion::toString( v ) ); } /*! \fn void OContact::setAnniversary( const QDate &date ) Sets the anniversary of the contact to \a date. */ void OContact::setAnniversary( const QDate &v ) { if ( ( !v.isNull() ) && ( v.isValid() ) ) replace( Qtopia::Anniversary, TimeConversion::toString( v ) ); } /*! \fn QDate OContact::birthday() const Returns the birthday of the contact. */ QDate OContact::birthday() const { - QDate empty; QString str = find( Qtopia::Birthday ); qWarning ("Birthday %s", str.latin1() ); if ( !str.isEmpty() ) return TimeConversion::fromString ( str ); else - return empty; + return QDate(); } /*! \fn QDate OContact::anniversary() const Returns the anniversary of the contact. */ QDate OContact::anniversary() const { QDate empty; QString str = find( Qtopia::Anniversary ); qWarning ("Anniversary %s", str.latin1() ); if ( !str.isEmpty() ) return TimeConversion::fromString ( str ); else return empty; } void OContact::insertEmail( const QString &v ) { //qDebug("insertEmail %s", v.latin1()); QString e = v.simplifyWhiteSpace(); QString def = defaultEmail(); // if no default, set it as the default email and don't insert if ( def.isEmpty() ) { setDefaultEmail( e ); // will insert into the list for us return; } // otherwise, insert assuming doesn't already exist QString emailsStr = find( Qtopia::Emails ); diff --git a/libopie2/opiepim/ocontact.cpp b/libopie2/opiepim/ocontact.cpp index bf27d0f..acd65c4 100644 --- a/libopie2/opiepim/ocontact.cpp +++ b/libopie2/opiepim/ocontact.cpp @@ -40,73 +40,75 @@ /*! \class Contact contact.h \brief The Contact class holds the data of an address book entry. This data includes information the name of the person, contact information, and business information such as deparment and job title. \ingroup qtopiaemb \ingroup qtopiadesktop */ Qtopia::UidGen OContact::sUidGen( Qtopia::UidGen::Qtopia ); /*! Creates a new, empty contact. */ OContact::OContact() : OPimRecord(), mMap(), d( 0 ) { } /*! \internal Creates a new contact. The properties of the contact are set from \a fromMap. */ OContact::OContact( const QMap<int, QString> &fromMap ) : OPimRecord(), mMap( fromMap ), d( 0 ) { QString cats = mMap[ Qtopia::AddressCategory ]; if ( !cats.isEmpty() ) setCategories( idsFromString( cats ) ); + QString uidStr = find( Qtopia::AddressUid ); - if ( uidStr.isEmpty() ) + if ( uidStr.isEmpty() || (uidStr.toInt() == 0) ){ + qWarning( "Invalid UID found. Generate new one.." ); setUid( uidGen().generate() ); - else + }else setUid( uidStr.toInt() ); - if ( !uidStr.isEmpty() ) - setUid( uidStr.toInt() ); +// if ( !uidStr.isEmpty() ) +// setUid( uidStr.toInt() ); } /*! Destroys a contact. */ OContact::~OContact() { } /*! \fn void OContact::setTitle( const QString &str ) Sets the title of the contact to \a str. */ /*! \fn void OContact::setFirstName( const QString &str ) Sets the first name of the contact to \a str. */ /*! \fn void OContact::setMiddleName( const QString &str ) Sets the middle name of the contact to \a str. */ /*! \fn void OContact::setLastName( const QString &str ) Sets the last name of the contact to \a str. */ /*! \fn void OContact::setSuffix( const QString &str ) Sets the suffix of the contact to \a str. */ /*! \fn void OContact::setFileAs( const QString &str ) Sets the contact to filed as \a str. */ @@ -542,70 +544,70 @@ QString OContact::toRichText() const str = businessMobile(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Business Mobile: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = businessPager(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Business Pager: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = profession(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Profession: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = assistant(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Assistant: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = manager(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Manager: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; str = gender(); if ( !str.isEmpty() && str.toInt() != 0 ) { if ( str.toInt() == 1 ) str = QObject::tr( "Male" ); else if ( str.toInt() == 2 ) str = QObject::tr( "Female" ); text += "<b>" + QObject::tr("Gender: ") + "</b>" + str + "<br>"; } str = spouse(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Spouse: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; - if ( !birthday().isValid() ){ + if ( birthday().isValid() ){ str = TimeString::numberDateString( birthday() ); text += "<b>" + QObject::tr("Birthday: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; } - if ( !anniversary().isValid() ){ + if ( anniversary().isValid() ){ str = TimeString::numberDateString( anniversary() ); text += "<b>" + QObject::tr("Anniversary: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; } str = nickname(); if ( !str.isEmpty() ) text += "<b>" + QObject::tr("Nickname: ") + "</b>" + Qtopia::escapeString(str) + "<br>"; // notes last if ( (value = notes()) ) { QRegExp reg("\n"); //QString tmp = Qtopia::escapeString(value); QString tmp = QStyleSheet::convertFromPlainText(value); //tmp.replace( reg, "<br>" ); text += "<br>" + tmp + "<br>"; } return text; } /*! \internal */ void OContact::insert( int key, const QString &v ) { QString value = v.stripWhiteSpace(); if ( value.isEmpty() ) mMap.remove( key ); else mMap.insert( key, value ); } @@ -1094,115 +1096,119 @@ static VObject *createVObject( const OContact &c ) safeAddPropValue( work_adr, VCPostalCodeProp, c.businessZip() ); safeAddPropValue( work_adr, VCCountryNameProp, c.businessCountry() ); VObject *work_phone = safeAddPropValue( vcard, VCTelephoneProp, c.businessPhone() ); safeAddProp( work_phone, VCWorkProp ); work_phone = safeAddPropValue( vcard, VCTelephoneProp, c.businessMobile() ); safeAddProp( work_phone, VCWorkProp ); safeAddProp( work_phone, VCCellularProp ); work_phone = safeAddPropValue( vcard, VCTelephoneProp, c.businessFax() ); safeAddProp( work_phone, VCWorkProp ); safeAddProp( work_phone, VCFaxProp ); work_phone = safeAddPropValue( vcard, VCTelephoneProp, c.businessPager() ); safeAddProp( work_phone, VCWorkProp ); safeAddProp( work_phone, VCPagerProp ); url = safeAddPropValue( vcard, VCURLProp, c.businessWebpage() ); safeAddProp( url, VCWorkProp ); VObject *title = safeAddPropValue( vcard, VCTitleProp, c.jobTitle() ); safeAddProp( title, VCWorkProp ); QStringList emails = c.emailList(); emails.prepend( c.defaultEmail() ); for( QStringList::Iterator it = emails.begin(); it != emails.end(); ++it ) { VObject *email = safeAddPropValue( vcard, VCEmailAddressProp, *it ); safeAddProp( email, VCInternetProp ); } safeAddPropValue( vcard, VCNoteProp, c.notes() ); // Exporting Birthday regarding RFC 2425 (5.8.4) - if ( !c.birthday().isValid() ){ + if ( c.birthday().isValid() ){ QString birthd_rfc2425 = QString("%1-%2-%3") .arg( c.birthday().year() ) .arg( c.birthday().month(), 2 ) .arg( c.birthday().day(), 2 ); // Now replace spaces with "0"... int pos = 0; while ( ( pos = birthd_rfc2425.find (' ') ) > 0 ) birthd_rfc2425.replace( pos, 1, "0" ); qWarning("Exporting birthday as: %s", birthd_rfc2425.latin1()); safeAddPropValue( vcard, VCBirthDateProp, birthd_rfc2425.latin1() ); } if ( !c.company().isEmpty() || !c.department().isEmpty() || !c.office().isEmpty() ) { VObject *org = safeAddProp( vcard, VCOrgProp ); safeAddPropValue( org, VCOrgNameProp, c.company() ); safeAddPropValue( org, VCOrgUnitProp, c.department() ); safeAddPropValue( org, VCOrgUnit2Prop, c.office() ); } // some values we have to export as custom fields safeAddPropValue( vcard, "X-Qtopia-Profession", c.profession() ); safeAddPropValue( vcard, "X-Qtopia-Manager", c.manager() ); safeAddPropValue( vcard, "X-Qtopia-Assistant", c.assistant() ); safeAddPropValue( vcard, "X-Qtopia-Spouse", c.spouse() ); safeAddPropValue( vcard, "X-Qtopia-Gender", c.gender() ); safeAddPropValue( vcard, "X-Qtopia-Anniversary", TimeConversion::toString( c.anniversary() ) ); safeAddPropValue( vcard, "X-Qtopia-Nickname", c.nickname() ); safeAddPropValue( vcard, "X-Qtopia-Children", c.children() ); return vcard; } /*! \internal */ static QDate convVCardDateToDate( const QString& datestr ) { int monthPos = datestr.find('-'); int dayPos = datestr.find('-', monthPos+1 ); int sep_ignore = 1; if ( monthPos == -1 || dayPos == -1 ) { qDebug("fromString didn't find - in str = %s; mpos = %d ypos = %d", datestr.latin1(), monthPos, dayPos ); - // Ok.. Outlook is violating ISO 8601, therefore we will try to read their format ( YYYYMMDD ) - monthPos = 4; - dayPos = 6; - sep_ignore = 0; - qDebug("Try with follwing positions str = %s; mpos = %d ypos = %d", datestr.latin1(), monthPos, dayPos ); + // Ok.. No "-" found, therefore we will try to read other format ( YYYYMMDD ) + if ( datestr.length() == 8 ){ + monthPos = 4; + dayPos = 6; + sep_ignore = 0; + qDebug("Try with follwing positions str = %s; mpos = %d ypos = %d", datestr.latin1(), monthPos, dayPos ); + } else { + return QDate(); + } } int y = datestr.left( monthPos ).toInt(); int m = datestr.mid( monthPos + sep_ignore, dayPos - monthPos - sep_ignore ).toInt(); int d = datestr.mid( dayPos + sep_ignore ).toInt(); qDebug("TimeConversion::fromString ymd = %s => %d %d %d; mpos = %d ypos = %d", datestr.latin1(), y, m, d, monthPos, dayPos); QDate date ( y,m,d ); return date; } static OContact parseVObject( VObject *obj ) { OContact c; VObjectIterator it; initPropIterator( &it, obj ); while( moreIteration( &it ) ) { VObject *o = nextVObject( &it ); QCString name = vObjectName( o ); QCString value = vObjectStringZValue( o ); if ( name == VCNameProp ) { VObjectIterator nit; initPropIterator( &nit, o ); while( moreIteration( &nit ) ) { VObject *o = nextVObject( &nit ); QCString name = vObjectTypeInfo( o ); QString value = vObjectStringZValue( o ); if ( name == VCNamePrefixesProp ) c.setTitle( value ); else if ( name == VCNameSuffixesProp ) c.setSuffix( value ); else if ( name == VCFamilyNameProp ) c.setLastName( value ); @@ -1520,71 +1526,70 @@ class QString OContact::recordField( int pos ) const return SLFIELDS[pos]; } // In future releases, we should store birthday and anniversary // internally as QDate instead of QString ! // QString is always too complicate to interprete (DD.MM.YY, DD/MM/YY, MM/DD/YY, etc..)(se) /*! \fn void OContact::setBirthday( const QDate& date ) Sets the birthday for the contact to \a date. */ void OContact::setBirthday( const QDate &v ) { if ( ( !v.isNull() ) && ( v.isValid() ) ) replace( Qtopia::Birthday, TimeConversion::toString( v ) ); } /*! \fn void OContact::setAnniversary( const QDate &date ) Sets the anniversary of the contact to \a date. */ void OContact::setAnniversary( const QDate &v ) { if ( ( !v.isNull() ) && ( v.isValid() ) ) replace( Qtopia::Anniversary, TimeConversion::toString( v ) ); } /*! \fn QDate OContact::birthday() const Returns the birthday of the contact. */ QDate OContact::birthday() const { - QDate empty; QString str = find( Qtopia::Birthday ); qWarning ("Birthday %s", str.latin1() ); if ( !str.isEmpty() ) return TimeConversion::fromString ( str ); else - return empty; + return QDate(); } /*! \fn QDate OContact::anniversary() const Returns the anniversary of the contact. */ QDate OContact::anniversary() const { QDate empty; QString str = find( Qtopia::Anniversary ); qWarning ("Anniversary %s", str.latin1() ); if ( !str.isEmpty() ) return TimeConversion::fromString ( str ); else return empty; } void OContact::insertEmail( const QString &v ) { //qDebug("insertEmail %s", v.latin1()); QString e = v.simplifyWhiteSpace(); QString def = defaultEmail(); // if no default, set it as the default email and don't insert if ( def.isEmpty() ) { setDefaultEmail( e ); // will insert into the list for us return; } // otherwise, insert assuming doesn't already exist QString emailsStr = find( Qtopia::Emails ); |