diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kresources/scalix/kabc/contact.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/scalix/kabc/contact.cpp')
-rw-r--r-- | kresources/scalix/kabc/contact.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/kresources/scalix/kabc/contact.cpp b/kresources/scalix/kabc/contact.cpp index 156ae01af..06c67442e 100644 --- a/kresources/scalix/kabc/contact.cpp +++ b/kresources/scalix/kabc/contact.cpp @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qdom.h> +#include <tqdom.h> #include <libkdepim/distributionlist.h> #include <kstaticdeleter.h> @@ -27,24 +27,24 @@ using namespace Scalix; -static QMap<QString, QString> *s_distListMap = 0; -static KStaticDeleter< QMap<QString, QString> > sd; +static TQMap<TQString, TQString> *s_distListMap = 0; +static KStaticDeleter< TQMap<TQString, TQString> > sd; -static QString custom( const QString &name, const KABC::Addressee &addr, const QString &defaultValue = QString() ) +static TQString custom( const TQString &name, const KABC::Addressee &addr, const TQString &defaultValue = TQString() ) { - const QString value = addr.custom( "Scalix", name ); + const TQString value = addr.custom( "Scalix", name ); if ( value.isEmpty() ) return defaultValue; else return value; } -static void setCustom( const QString &name, const QString &value, KABC::Addressee &addr ) +static void setCustom( const TQString &name, const TQString &value, KABC::Addressee &addr ) { addr.insertCustom( "Scalix", name, value ); } -QString Contact::toXml( const KABC::Addressee &addr ) +TQString Contact::toXml( const KABC::Addressee &addr ) { /** * Handle distribution lists. @@ -53,13 +53,13 @@ QString Contact::toXml( const KABC::Addressee &addr ) if ( s_distListMap ) return (*s_distListMap)[ addr.uid() ]; else - return QString(); + return TQString(); } /** * Handle normal contacts. */ - QString xml; + TQString xml; xml += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; xml += "<contact>\n"; @@ -86,9 +86,9 @@ QString Contact::toXml( const KABC::Addressee &addr ) xml += "<company_name>" + addr.organization() + "</company_name>\n"; xml += "<job_title>" + addr.title() + "</job_title>\n"; - QStringList emails = addr.emails(); + TQStringList emails = addr.emails(); for ( uint i = 0; i < 3; ++i ) { - QString type, address, comment, display; + TQString type, address, comment, display; if ( i < emails.count() ) { type = "SMTP"; @@ -103,19 +103,19 @@ QString Contact::toXml( const KABC::Addressee &addr ) comment = addr.formattedName(); display = emails[ i ]; } else { - comment = custom( QString( "email%1_address_with_comment" ).arg( i + 1 ), addr ); - display = custom( QString( "email%1_display_name" ).arg( i + 1 ), addr ); + comment = custom( TQString( "email%1_address_with_comment" ).arg( i + 1 ), addr ); + display = custom( TQString( "email%1_display_name" ).arg( i + 1 ), addr ); } } - xml += QString( "<email%1_address_type>" ).arg( i + 1 ) + type + - QString( "</email%1_address_type>" ).arg( i + 1 ) +"\n"; - xml += QString( "<email%1_address>" ).arg( i + 1 ) + address + - QString( "</email%1_address>" ).arg( i + 1 ) +"\n"; - xml += QString( "<email%1_address_with_comment>" ).arg( i + 1 ) + comment + - QString( "</email%1_address_with_comment>" ).arg( i + 1 ) + "\n"; - xml += QString( "<email%1_display_name>" ).arg( i + 1 ) + display + - QString( "</email%1_display_name>" ).arg( i + 1 ) + "\n"; + xml += TQString( "<email%1_address_type>" ).arg( i + 1 ) + type + + TQString( "</email%1_address_type>" ).arg( i + 1 ) +"\n"; + xml += TQString( "<email%1_address>" ).arg( i + 1 ) + address + + TQString( "</email%1_address>" ).arg( i + 1 ) +"\n"; + xml += TQString( "<email%1_address_with_comment>" ).arg( i + 1 ) + comment + + TQString( "</email%1_address_with_comment>" ).arg( i + 1 ) + "\n"; + xml += TQString( "<email%1_display_name>" ).arg( i + 1 ) + display + + TQString( "</email%1_display_name>" ).arg( i + 1 ) + "\n"; } KABC::PhoneNumber phone = addr.phoneNumber( KABC::PhoneNumber::Home ); @@ -176,22 +176,22 @@ QString Contact::toXml( const KABC::Addressee &addr ) return xml; } -KABC::Addressee Contact::fromXml( const QString &xml ) +KABC::Addressee Contact::fromXml( const TQString &xml ) { - QDomDocument document; + TQDomDocument document; - QString errorMsg; + TQString errorMsg; int errorLine, errorColumn; if ( !document.setContent( xml, true, &errorMsg, &errorLine, &errorColumn ) ) { qDebug( "Error parsing XML in Scalix::Contact::fromXml: %s (%d,%d)", errorMsg.latin1(), errorLine, errorColumn ); return KABC::Addressee(); } - QDomElement contactElement = document.documentElement(); + TQDomElement contactElement = document.documentElement(); if ( contactElement.tagName() != "contact" ) { if ( contactElement.tagName() == "distlist" ) { - const QDomNodeList names = contactElement.elementsByTagName( "display_name" ); - const QString listName = ( names.count() == 1 ? names.item( 0 ).toElement().text() : "Scalix Dummy List" ); + const TQDomNodeList names = contactElement.elementsByTagName( "display_name" ); + const TQString listName = ( names.count() == 1 ? names.item( 0 ).toElement().text() : "Scalix Dummy List" ); /** * As we can't provide distribution list functionality we store the entry @@ -201,7 +201,7 @@ KABC::Addressee Contact::fromXml( const QString &xml ) list.setName( listName ); if ( !s_distListMap ) - sd.setObject( s_distListMap, new QMap<QString, QString>() ); + sd.setObject( s_distListMap, new TQMap<TQString, TQString>() ); s_distListMap->insert( list.uid(), xml ); @@ -212,7 +212,7 @@ KABC::Addressee Contact::fromXml( const QString &xml ) } } - QString emails[ 3 ]; + TQString emails[ 3 ]; KABC::Address homeAddress( KABC::Address::Home ); KABC::Address workAddress( KABC::Address::Work ); KABC::Address otherAddress( KABC::Address::Dom ); @@ -220,9 +220,9 @@ KABC::Addressee Contact::fromXml( const QString &xml ) KABC::Addressee addr; setCustom( "comes_from_scalix", "true", addr ); - QDomNode node = contactElement.firstChild(); + TQDomNode node = contactElement.firstChild(); while ( !node.isNull() ) { - QDomElement element = node.toElement(); + TQDomElement element = node.toElement(); if ( !element.isNull() ) { if ( element.tagName() == "direct_ref" ) addr.setUid( element.text() ); @@ -235,7 +235,7 @@ KABC::Addressee Contact::fromXml( const QString &xml ) else if ( element.tagName() == "send_rich_info" ) setCustom( "send_rich_info", element.text(), addr ); else if ( element.tagName() == "last_modification_time" ) - addr.setRevision( QDateTime::fromString( element.text(), Qt::ISODate ) ); + addr.setRevision( TQDateTime::fromString( element.text(), Qt::ISODate ) ); // name else if ( element.tagName() == "display_name_prefix" ) @@ -352,7 +352,7 @@ KABC::Addressee Contact::fromXml( const QString &xml ) addr.insertCustom( "KADDRESSBOOK", "X-SpousesName", element.text() ); else if ( element.tagName() == "bday" ) - addr.setBirthday( QDateTime::fromString( element.text(), Qt::ISODate ) ); + addr.setBirthday( TQDateTime::fromString( element.text(), Qt::ISODate ) ); else if ( element.tagName() == "anniversary" ) addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", element.text() ); else |