author | zautrix <zautrix> | 2005-10-28 14:43:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-28 14:43:31 (UTC) |
commit | ab099bc1be027fe01dc252a9d7a0f8821e782d65 (patch) (side-by-side diff) | |
tree | 85bfb03f334da60dffcc52d54202f51d0f947e3f /kabc/field.cpp | |
parent | caaa030d8bc2aa82c53e5d30abc314b992d7226f (diff) | |
download | kdepimpi-ab099bc1be027fe01dc252a9d7a0f8821e782d65.zip kdepimpi-ab099bc1be027fe01dc252a9d7a0f8821e782d65.tar.gz kdepimpi-ab099bc1be027fe01dc252a9d7a0f8821e782d65.tar.bz2 |
fixxxx
-rw-r--r-- | kabc/field.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kabc/field.cpp b/kabc/field.cpp index 20885de..6f2b307 100644 --- a/kabc/field.cpp +++ b/kabc/field.cpp @@ -67,49 +67,50 @@ class Field::FieldImpl BusinessAddressStreet, BusinessAddressLocality, BusinessAddressRegion, BusinessAddressPostalCode, BusinessAddressCountry, BusinessAddressLabel, HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, CarPhone, Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, Url, Resource, Sip, MobileWorkPhone, - MobileHomePhone + MobileHomePhone, + OtherPhone }; int fieldId() { return mFieldId; } int category() { return mCategory; } QString label() { return mLabel; } QString key() { return mKey; } QString app() { return mApp; } private: int mFieldId; int mCategory; QString mLabel; QString mKey; QString mApp; }; Field::List Field::mAllFields; Field::List Field::mDefaultFields; Field::List Field::mCustomFields; @@ -185,48 +186,50 @@ QString Field::label() case FieldImpl::Isdn: return Addressee::isdnLabel(); case FieldImpl::Pager: return Addressee::pagerLabel(); case FieldImpl::Email: return Addressee::emailLabel(); case FieldImpl::Mailer: return Addressee::mailerLabel(); case FieldImpl::Title: return Addressee::titleLabel(); case FieldImpl::Role: return Addressee::roleLabel(); case FieldImpl::Organization: return Addressee::organizationLabel(); case FieldImpl::Note: return Addressee::noteLabel(); case FieldImpl::Url: return Addressee::urlLabel(); case FieldImpl::Resource: return Addressee::resourceLabel(); case FieldImpl::Category: return Addressee::categoryLabel(); case FieldImpl::Sip: return Addressee::sipLabel(); + case FieldImpl::OtherPhone: + return Addressee::otherPhoneLabel(); case FieldImpl::CustomField: return mImpl->label(); default: return i18n("Unknown Field"); } } int Field::category() { return mImpl->category(); } QString Field::categoryLabel( int category ) { switch ( category ) { case All: return i18n("All"); case Frequent: return i18n("Frequent"); case Address: return i18n("Address"); case Email: return i18n("Email"); case Personal: @@ -289,48 +292,50 @@ QString Field::value( const KABC::Addressee &a ) case FieldImpl::Category: return a.categories().join(","); case FieldImpl::HomePhone: return a.phoneNumber( PhoneNumber::Home| PhoneNumber::Pref ).number(); case FieldImpl::BusinessPhone: return a.phoneNumber( PhoneNumber::Work| PhoneNumber::Pref ).number(); case FieldImpl::MobilePhone: return a.phoneNumber( PhoneNumber::Cell ).number(); case FieldImpl::MobileWorkPhone: return a.phoneNumber( PhoneNumber::Car ).number(); case FieldImpl::MobileHomePhone: return a.phoneNumber( PhoneNumber::Cell ).number(); case FieldImpl::HomeFax: return a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ).number(); case FieldImpl::BusinessFax: return a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ).number(); case FieldImpl::CarPhone: return a.phoneNumber( PhoneNumber::Car ).number(); case FieldImpl::Isdn: return a.phoneNumber( PhoneNumber::Isdn ).number(); case FieldImpl::Pager: return a.phoneNumber( PhoneNumber::Pager ).number(); case FieldImpl::Sip: return a.phoneNumber( PhoneNumber::Pcs | PhoneNumber::Pref ).number(); + case FieldImpl::OtherPhone: + return a.phoneNumber( PhoneNumber::Voice ).number(); case FieldImpl::HomeAddressStreet: return a.address( Address::Home ).street(); case FieldImpl::HomeAddressLocality: return a.address( Address::Home ).locality(); case FieldImpl::HomeAddressRegion: return a.address( Address::Home ).region(); case FieldImpl::HomeAddressPostalCode: return a.address( Address::Home ).postalCode(); case FieldImpl::HomeAddressCountry: return a.address( Address::Home ).country(); case FieldImpl::BusinessAddressStreet: return a.address( Address::Work ).street(); case FieldImpl::BusinessAddressLocality: return a.address( Address::Work ).locality(); case FieldImpl::BusinessAddressRegion: return a.address( Address::Work ).region(); case FieldImpl::BusinessAddressPostalCode: return a.address( Address::Work ).postalCode(); case FieldImpl::BusinessAddressCountry: return a.address( Address::Work ).country(); case FieldImpl::CustomField: return a.custom( mImpl->app(), mImpl->key() ); default: return QString::null; @@ -421,48 +426,49 @@ Field::List Field::allFields() createField( FieldImpl::BusinessAddressLocality, Address|Organization ); createField( FieldImpl::BusinessAddressRegion, Address|Organization ); createField( FieldImpl::BusinessAddressPostalCode, Address|Organization ); createField( FieldImpl::BusinessAddressCountry, Address|Organization ); createField( FieldImpl::BusinessAddressLabel, Address|Organization ); createField( FieldImpl::HomePhone, Personal|Frequent ); createField( FieldImpl::BusinessPhone, Organization|Frequent ); createField( FieldImpl::MobilePhone, Frequent ); createField( FieldImpl::MobileHomePhone, Frequent ); createField( FieldImpl::MobileWorkPhone, Frequent ); createField( FieldImpl::HomeFax ); createField( FieldImpl::BusinessFax ); createField( FieldImpl::CarPhone ); createField( FieldImpl::Isdn ); createField( FieldImpl::Pager ); createField( FieldImpl::Email, Email|Frequent ); createField( FieldImpl::Mailer, Email ); createField( FieldImpl::Title, Organization ); createField( FieldImpl::Role, Organization ); createField( FieldImpl::Organization, Organization ); createField( FieldImpl::Note ); createField( FieldImpl::Url ); createField( FieldImpl::Resource ); createField( FieldImpl::Sip ); + createField( FieldImpl::OtherPhone ); } return mAllFields; } Field::List Field::defaultFields() { if ( mDefaultFields.isEmpty() ) { createDefaultField( FieldImpl::GivenName ); createDefaultField( FieldImpl::FamilyName ); createDefaultField( FieldImpl::Email ); } return mDefaultFields; } void Field::createField( int id, int category ) { mAllFields.append( new Field( new FieldImpl( id, category ) ) ); } void Field::createDefaultField( int id, int category ) { mDefaultFields.append( new Field( new FieldImpl( id, category ) ) ); |