diff options
Diffstat (limited to 'tderesources/groupwise/soap/contactconverter.cpp')
-rw-r--r-- | tderesources/groupwise/soap/contactconverter.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/tderesources/groupwise/soap/contactconverter.cpp b/tderesources/groupwise/soap/contactconverter.cpp index 1ce391381..2076ccb6f 100644 --- a/tderesources/groupwise/soap/contactconverter.cpp +++ b/tderesources/groupwise/soap/contactconverter.cpp @@ -28,7 +28,7 @@ ContactConverter::ContactConverter( struct soap* soap ) { } -ngwt__Contact* ContactConverter::convertToContact( const KABC::Addressee &addr ) +ngwt__Contact* ContactConverter::convertToContact( const TDEABC::Addressee &addr ) { if ( addr.isEmpty() ) return 0; @@ -128,15 +128,15 @@ ngwt__Contact* ContactConverter::convertToContact( const KABC::Addressee &addr ) phoneList->default_ = 0; std::vector<class ngwt__PhoneNumber*> *list = soap_new_std__vectorTemplateOfPointerTongwt__PhoneNumber( soap(), -1 ); - KABC::PhoneNumber::List phones = addr.phoneNumbers(); - KABC::PhoneNumber::List::Iterator it; + TDEABC::PhoneNumber::List phones = addr.phoneNumbers(); + TDEABC::PhoneNumber::List::Iterator it; for ( it = phones.begin(); it != phones.end(); ++it ) { ngwt__PhoneNumber* number = convertPhoneNumber( *it ); if ( number ) { list->push_back( number ); // if preferred number assign it - if ( (*it).type() & KABC::PhoneNumber::Pref ) + if ( (*it).type() & TDEABC::PhoneNumber::Pref ) phoneList->default_ = qStringToString( (*it).number() ); } } @@ -151,8 +151,8 @@ ngwt__Contact* ContactConverter::convertToContact( const KABC::Addressee &addr ) ngwt__PostalAddressList* addressList = soap_new_ngwt__PostalAddressList( soap(), -1 ); std::vector<class ngwt__PostalAddress*> *list = soap_new_std__vectorTemplateOfPointerTongwt__PostalAddress( soap(), -1 ); - KABC::Address::List addresses = addr.addresses(); - KABC::Address::List::Iterator it; + TDEABC::Address::List addresses = addr.addresses(); + TDEABC::Address::List::Iterator it; for ( it = addresses.begin(); it != addresses.end(); ++it ) { ngwt__PostalAddress* address = convertPostalAddress( *it ); if ( address ) @@ -213,10 +213,10 @@ ngwt__Contact* ContactConverter::convertToContact( const KABC::Addressee &addr ) return contact; } -KABC::Addressee ContactConverter::convertFromAddressBookItem( ngwt__AddressBookItem * addrBkItem ) +TDEABC::Addressee ContactConverter::convertFromAddressBookItem( ngwt__AddressBookItem * addrBkItem ) { //kdDebug() << "ContactConverter::convertFromAddressBookItem()" << endl; - KABC::Addressee addr; + TDEABC::Addressee addr; if ( !addrBkItem ) { kdDebug() << "Null AddressBookItem, bailing out!" << endl; @@ -232,17 +232,17 @@ KABC::Addressee ContactConverter::convertFromAddressBookItem( ngwt__AddressBookI return addr; } -KABC::Addressee ContactConverter::convertFromResource( ngwt__Resource* resource ) +TDEABC::Addressee ContactConverter::convertFromResource( ngwt__Resource* resource ) { //kdDebug() << "ContactConverter::convertFromResource()" << endl; - KABC::Addressee addr = convertFromAddressBookItem( resource ); + TDEABC::Addressee addr = convertFromAddressBookItem( resource ); if ( !resource ) { kdDebug() << "Null Resource, bailing out!" << endl; return addr; } if ( resource->phone ) - addr.insertPhoneNumber( KABC::PhoneNumber( stringToTQString( resource->phone ), KABC::PhoneNumber::Work ) ); + addr.insertPhoneNumber( TDEABC::PhoneNumber( stringToTQString( resource->phone ), TDEABC::PhoneNumber::Work ) ); if ( resource->email ) addr.insertEmail( stringToTQString( resource->email ), true ); if ( resource->owner ) @@ -252,10 +252,10 @@ KABC::Addressee ContactConverter::convertFromResource( ngwt__Resource* resource return addr; } -KABC::Addressee ContactConverter::convertFromGroup( ngwt__Group* group) +TDEABC::Addressee ContactConverter::convertFromGroup( ngwt__Group* group) { // kdDebug() << "ContactConverter::convertFromGroup()" << endl; - KABC::Addressee addr = convertFromAddressBookItem( group ); + TDEABC::Addressee addr = convertFromAddressBookItem( group ); if ( !group ) { kdDebug() << "Null Resource, bailing out!" << endl; @@ -265,11 +265,11 @@ KABC::Addressee ContactConverter::convertFromGroup( ngwt__Group* group) return addr; } -KABC::Addressee ContactConverter::convertFromContact( ngwt__Contact* contact ) +TDEABC::Addressee ContactConverter::convertFromContact( ngwt__Contact* contact ) { // kdDebug() << "ContactConverter::convertFromContact()" << endl; - KABC::Addressee addr = convertFromAddressBookItem( contact ); + TDEABC::Addressee addr = convertFromAddressBookItem( contact ); if ( !contact ) { @@ -329,10 +329,10 @@ KABC::Addressee ContactConverter::convertFromContact( ngwt__Contact* contact ) std::vector<class ngwt__PhoneNumber*> list = contact->phoneList->phone; std::vector<class ngwt__PhoneNumber*>::const_iterator it; for ( it = list.begin(); it != list.end(); ++it ) { - KABC::PhoneNumber phone = convertPhoneNumber( *it ); + TDEABC::PhoneNumber phone = convertPhoneNumber( *it ); if ( !phone.number().isEmpty() ) { if ( phone.number() == defaultNumber ) - phone.setType( phone.type() | KABC::PhoneNumber::Pref ); + phone.setType( phone.type() | TDEABC::PhoneNumber::Pref ); addr.insertPhoneNumber( phone ); } } @@ -343,7 +343,7 @@ KABC::Addressee ContactConverter::convertFromContact( ngwt__Contact* contact ) std::vector<class ngwt__PostalAddress*> list = contact->addressList->address; std::vector<class ngwt__PostalAddress*>::const_iterator it; for ( it = list.begin(); it != list.end(); ++it ) { - KABC::Address address = convertPostalAddress( *it ); + TDEABC::Address address = convertPostalAddress( *it ); if ( !address.isEmpty() ) addr.insertAddress( address ); } @@ -425,24 +425,24 @@ KABC::Addressee ContactConverter::convertFromContact( ngwt__Contact* contact ) return addr; } -KABC::PhoneNumber ContactConverter::convertPhoneNumber( ngwt__PhoneNumber *phone ) const +TDEABC::PhoneNumber ContactConverter::convertPhoneNumber( ngwt__PhoneNumber *phone ) const { - KABC::PhoneNumber phoneNumber; + TDEABC::PhoneNumber phoneNumber; if ( !phone ) return phoneNumber; phoneNumber.setNumber( stringToTQString( phone->__item ) ); if ( phone->type == Fax ) { - phoneNumber.setType( KABC::PhoneNumber::Fax ); + phoneNumber.setType( TDEABC::PhoneNumber::Fax ); } else if ( phone->type == Home ) { - phoneNumber.setType( KABC::PhoneNumber::Home ); + phoneNumber.setType( TDEABC::PhoneNumber::Home ); } else if ( phone->type == Mobile ) { - phoneNumber.setType( KABC::PhoneNumber::Cell ); + phoneNumber.setType( TDEABC::PhoneNumber::Cell ); } else if ( phone->type == Office ) { - phoneNumber.setType( KABC::PhoneNumber::Work ); + phoneNumber.setType( TDEABC::PhoneNumber::Work ); } else if ( phone->type == Pager ) { - phoneNumber.setType( KABC::PhoneNumber::Pager ); + phoneNumber.setType( TDEABC::PhoneNumber::Pager ); } else { // should never been reached, phone numbers have always a type set... } @@ -450,7 +450,7 @@ KABC::PhoneNumber ContactConverter::convertPhoneNumber( ngwt__PhoneNumber *phone return phoneNumber; } -ngwt__PhoneNumber* ContactConverter::convertPhoneNumber( const KABC::PhoneNumber &number ) const +ngwt__PhoneNumber* ContactConverter::convertPhoneNumber( const TDEABC::PhoneNumber &number ) const { if ( number.number().isEmpty() ) return 0; @@ -458,15 +458,15 @@ ngwt__PhoneNumber* ContactConverter::convertPhoneNumber( const KABC::PhoneNumber ngwt__PhoneNumber* phoneNumber = soap_new_ngwt__PhoneNumber( soap(), -1 ); phoneNumber->__item = number.number().utf8().data(); - if ( number.type() & KABC::PhoneNumber::Fax ) { + if ( number.type() & TDEABC::PhoneNumber::Fax ) { phoneNumber->type = Fax; - } else if ( number.type() == KABC::PhoneNumber::Home ) { + } else if ( number.type() == TDEABC::PhoneNumber::Home ) { phoneNumber->type = Home; - } else if ( number.type() & KABC::PhoneNumber::Cell ) { + } else if ( number.type() & TDEABC::PhoneNumber::Cell ) { phoneNumber->type = Mobile; - } else if ( number.type() == KABC::PhoneNumber::Work ) { + } else if ( number.type() == TDEABC::PhoneNumber::Work ) { phoneNumber->type = Office; - } else if ( number.type() & KABC::PhoneNumber::Pager ) { + } else if ( number.type() & TDEABC::PhoneNumber::Pager ) { phoneNumber->type = Pager; } else { // TODO: cache unsupported types @@ -475,9 +475,9 @@ ngwt__PhoneNumber* ContactConverter::convertPhoneNumber( const KABC::PhoneNumber return phoneNumber; } -KABC::Address ContactConverter::convertPostalAddress( ngwt__PostalAddress *addr ) const +TDEABC::Address ContactConverter::convertPostalAddress( ngwt__PostalAddress *addr ) const { - KABC::Address address; + TDEABC::Address address; if ( !addr ) return address; @@ -501,9 +501,9 @@ KABC::Address ContactConverter::convertPostalAddress( ngwt__PostalAddress *addr address.setCountry( stringToTQString( addr->country ) ); if ( addr->type == Home_ ) { - address.setType( KABC::Address::Home ); + address.setType( TDEABC::Address::Home ); } else if ( addr->type == Office_ ) { - address.setType( KABC::Address::Work ); + address.setType( TDEABC::Address::Work ); } else { // should never been reached, addresses have always a type set... } @@ -511,7 +511,7 @@ KABC::Address ContactConverter::convertPostalAddress( ngwt__PostalAddress *addr return address; } -ngwt__PostalAddress* ContactConverter::convertPostalAddress( const KABC::Address &address ) +ngwt__PostalAddress* ContactConverter::convertPostalAddress( const TDEABC::Address &address ) { if ( address.isEmpty() ) return 0; @@ -550,9 +550,9 @@ ngwt__PostalAddress* ContactConverter::convertPostalAddress( const KABC::Address else postalAddress->country = 0; - if ( address.type() & KABC::Address::Home ) { + if ( address.type() & TDEABC::Address::Home ) { postalAddress->type = Home_; - } else if ( address.type() & KABC::Address::Work ) { + } else if ( address.type() & TDEABC::Address::Work ) { postalAddress->type = Office_; } else { // TODO: cache unsupported types @@ -561,7 +561,7 @@ ngwt__PostalAddress* ContactConverter::convertPostalAddress( const KABC::Address return postalAddress; } -ngwt__ImAddressList* ContactConverter::convertImAddresses( const KABC::Addressee& addr ) +ngwt__ImAddressList* ContactConverter::convertImAddresses( const TDEABC::Addressee& addr ) { //return 0; /* TODO: use IM address dedicated functions in KDE 4.0. |