summaryrefslogtreecommitdiffstats
path: root/tderesources/scalix/tdeabc/contact.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tderesources/scalix/tdeabc/contact.cpp')
-rw-r--r--tderesources/scalix/tdeabc/contact.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/tderesources/scalix/tdeabc/contact.cpp b/tderesources/scalix/tdeabc/contact.cpp
index 457a34e77..190837a0d 100644
--- a/tderesources/scalix/tdeabc/contact.cpp
+++ b/tderesources/scalix/tdeabc/contact.cpp
@@ -30,7 +30,7 @@ using namespace Scalix;
static TQMap<TQString, TQString> *s_distListMap = 0;
static KStaticDeleter< TQMap<TQString, TQString> > sd;
-static TQString custom( const TQString &name, const KABC::Addressee &addr, const TQString &defaultValue = TQString() )
+static TQString custom( const TQString &name, const TDEABC::Addressee &addr, const TQString &defaultValue = TQString() )
{
const TQString value = addr.custom( "Scalix", name );
if ( value.isEmpty() )
@@ -39,12 +39,12 @@ static TQString custom( const TQString &name, const KABC::Addressee &addr, const
return value;
}
-static void setCustom( const TQString &name, const TQString &value, KABC::Addressee &addr )
+static void setCustom( const TQString &name, const TQString &value, TDEABC::Addressee &addr )
{
addr.insertCustom( "Scalix", name, value );
}
-TQString Contact::toXml( const KABC::Addressee &addr )
+TQString Contact::toXml( const TDEABC::Addressee &addr )
{
/**
* Handle distribution lists.
@@ -118,44 +118,44 @@ TQString Contact::toXml( const KABC::Addressee &addr )
TQString( "</email%1_display_name>" ).arg( i + 1 ) + "\n";
}
- KABC::PhoneNumber phone = addr.phoneNumber( KABC::PhoneNumber::Home );
+ TDEABC::PhoneNumber phone = addr.phoneNumber( TDEABC::PhoneNumber::Home );
xml += "<home_phone_number>" + phone.number() + "</home_phone_number>\n";
- phone = addr.phoneNumber( KABC::PhoneNumber::Work );
+ phone = addr.phoneNumber( TDEABC::PhoneNumber::Work );
xml += "<work_phone_number>" + phone.number() + "</work_phone_number>\n";
- phone = addr.phoneNumber( KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax );
+ phone = addr.phoneNumber( TDEABC::PhoneNumber::Work | TDEABC::PhoneNumber::Fax );
xml += "<work_fax_number>" + phone.number() + "</work_fax_number>\n";
- phone = addr.phoneNumber( KABC::PhoneNumber::Cell );
+ phone = addr.phoneNumber( TDEABC::PhoneNumber::Cell );
xml += "<mobile_phone_number>" + phone.number() + "</mobile_phone_number>\n";
- const KABC::Address workAddress = addr.address( KABC::Address::Work );
+ const TDEABC::Address workAddress = addr.address( TDEABC::Address::Work );
xml += "<work_address_street>" + workAddress.street() + "</work_address_street>\n";
xml += "<work_address_zip>" + workAddress.postalCode() + "</work_address_zip>\n";
xml += "<work_address_city>" + workAddress.locality() + "</work_address_city>\n";
xml += "<work_address_state>" + workAddress.region() + "</work_address_state>\n";
xml += "<work_address_country>" + workAddress.country() + "</work_address_country>\n";
- const KABC::Address homeAddress = addr.address( KABC::Address::Home );
+ const TDEABC::Address homeAddress = addr.address( TDEABC::Address::Home );
xml += "<home_address_street>" + homeAddress.street() + "</home_address_street>\n";
xml += "<home_address_zip>" + homeAddress.postalCode() + "</home_address_zip>\n";
xml += "<home_address_city>" + homeAddress.locality() + "</home_address_city>\n";
xml += "<home_address_state>" + homeAddress.region() + "</home_address_state>\n";
xml += "<home_address_country>" + homeAddress.country() + "</home_address_country>\n";
- const KABC::Address otherAddress = addr.address( KABC::Address::Dom );
+ const TDEABC::Address otherAddress = addr.address( TDEABC::Address::Dom );
xml += "<other_address_street>" + otherAddress.street() + "</other_address_street>\n";
xml += "<other_address_zip>" + otherAddress.postalCode() + "</other_address_zip>\n";
xml += "<other_address_city>" + otherAddress.locality() + "</other_address_city>\n";
xml += "<other_address_state>" + otherAddress.region() + "</other_address_state>\n";
xml += "<other_address_country>" + otherAddress.country() + "</other_address_country>\n";
- if ( homeAddress.type() & KABC::Address::Pref )
+ if ( homeAddress.type() & TDEABC::Address::Pref )
xml += "<selected_mailing_address>1</selected_mailing_address>\n";
- else if ( workAddress.type() & KABC::Address::Pref )
+ else if ( workAddress.type() & TDEABC::Address::Pref )
xml += "<selected_mailing_address>2</selected_mailing_address>\n";
- else if ( otherAddress.type() & KABC::Address::Pref )
+ else if ( otherAddress.type() & TDEABC::Address::Pref )
xml += "<selected_mailing_address>3</selected_mailing_address>\n";
xml += "<im_address>" + addr.custom( "KADDRESSBOOK", "X-IMAddress" ) + "</im_address>\n";
@@ -176,7 +176,7 @@ TQString Contact::toXml( const KABC::Addressee &addr )
return xml;
}
-KABC::Addressee Contact::fromXml( const TQString &xml )
+TDEABC::Addressee Contact::fromXml( const TQString &xml )
{
TQDomDocument document;
@@ -184,7 +184,7 @@ KABC::Addressee Contact::fromXml( const TQString &xml )
int errorLine, errorColumn;
if ( !document.setContent( xml, true, &errorMsg, &errorLine, &errorColumn ) ) {
tqDebug( "Error parsing XML in Scalix::Contact::fromXml: %s (%d,%d)", errorMsg.latin1(), errorLine, errorColumn );
- return KABC::Addressee();
+ return TDEABC::Addressee();
}
TQDomElement contactElement = document.documentElement();
@@ -208,16 +208,16 @@ KABC::Addressee Contact::fromXml( const TQString &xml )
return list;
} else {
tqDebug( "Error interpreting XML in Scalix::Contact::fromXml: no 'contact' or 'distlist' tag found" );
- return KABC::Addressee();
+ return TDEABC::Addressee();
}
}
TQString emails[ 3 ];
- KABC::Address homeAddress( KABC::Address::Home );
- KABC::Address workAddress( KABC::Address::Work );
- KABC::Address otherAddress( KABC::Address::Dom );
+ TDEABC::Address homeAddress( TDEABC::Address::Home );
+ TDEABC::Address workAddress( TDEABC::Address::Work );
+ TDEABC::Address otherAddress( TDEABC::Address::Dom );
- KABC::Addressee addr;
+ TDEABC::Addressee addr;
setCustom( "comes_from_scalix", "true", addr );
TQDomNode node = contactElement.firstChild();
@@ -275,13 +275,13 @@ KABC::Addressee Contact::fromXml( const TQString &xml )
// phone numbers
else if ( element.tagName() == "home_phone_number" )
- addr.insertPhoneNumber( KABC::PhoneNumber( element.text(), KABC::PhoneNumber::Home ) );
+ addr.insertPhoneNumber( TDEABC::PhoneNumber( element.text(), TDEABC::PhoneNumber::Home ) );
else if ( element.tagName() == "work_phone_number" )
- addr.insertPhoneNumber( KABC::PhoneNumber( element.text(), KABC::PhoneNumber::Work ) );
+ addr.insertPhoneNumber( TDEABC::PhoneNumber( element.text(), TDEABC::PhoneNumber::Work ) );
else if ( element.tagName() == "work_fax_number" )
- addr.insertPhoneNumber( KABC::PhoneNumber( element.text(), KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax ) );
+ addr.insertPhoneNumber( TDEABC::PhoneNumber( element.text(), TDEABC::PhoneNumber::Work | TDEABC::PhoneNumber::Fax ) );
else if ( element.tagName() == "mobile_phone_number" )
- addr.insertPhoneNumber( KABC::PhoneNumber( element.text(), KABC::PhoneNumber::Cell ) );
+ addr.insertPhoneNumber( TDEABC::PhoneNumber( element.text(), TDEABC::PhoneNumber::Cell ) );
// address (work)
else if ( element.tagName() == "work_address_street" )
@@ -322,13 +322,13 @@ KABC::Addressee Contact::fromXml( const TQString &xml )
else if ( element.tagName() == "selected_mailing_address" )
switch ( element.text().toInt() ) {
case 1:
- homeAddress.setType( homeAddress.type() | KABC::Address::Pref );
+ homeAddress.setType( homeAddress.type() | TDEABC::Address::Pref );
break;
case 2:
- workAddress.setType( workAddress.type() | KABC::Address::Pref );
+ workAddress.setType( workAddress.type() | TDEABC::Address::Pref );
break;
case 3:
- otherAddress.setType( otherAddress.type() | KABC::Address::Pref );
+ otherAddress.setType( otherAddress.type() | TDEABC::Address::Pref );
break;
default:
Q_ASSERT( !"Unknown selected_mailing_address enum" );