diff options
Diffstat (limited to 'kaddressbook/xxport/vcard_xxport.cpp')
-rw-r--r-- | kaddressbook/xxport/vcard_xxport.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp index b12779cbb..293879cc5 100644 --- a/kaddressbook/xxport/vcard_xxport.cpp +++ b/kaddressbook/xxport/vcard_xxport.cpp @@ -55,10 +55,10 @@ K_EXPORT_KADDRESSBOOK_XXFILTER( libkaddrbk_vcard_xxport, VCardXXPort ) class VCardViewerDialog : public KDialogBase { public: - VCardViewerDialog( const KABC::Addressee::List &list, + VCardViewerDialog( const TDEABC::Addressee::List &list, TQWidget *parent, const char *name = 0 ); - KABC::Addressee::List contacts() const; + TDEABC::Addressee::List contacts() const; protected: void slotUser1(); @@ -71,8 +71,8 @@ class VCardViewerDialog : public KDialogBase KPIM::AddresseeView *mView; - KABC::Addressee::List mContacts; - KABC::Addressee::List::Iterator mIt; + TDEABC::Addressee::List mContacts; + TDEABC::Addressee::List::Iterator mIt; }; class VCardExportSelectionDialog : public KDialogBase @@ -93,7 +93,7 @@ class VCardExportSelectionDialog : public KDialogBase TQCheckBox *mEncryptionKeys; }; -VCardXXPort::VCardXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *name ) +VCardXXPort::VCardXXPort( TDEABC::AddressBook *ab, TQWidget *parent, const char *name ) : KAB::XXPort( ab, parent, name ) { createImportAction( i18n( "Import vCard..." ) ); @@ -101,11 +101,11 @@ VCardXXPort::VCardXXPort( KABC::AddressBook *ab, TQWidget *parent, const char *n createExportAction( i18n( "Export vCard 3.0..." ), "v30" ); } -bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const TQString &data ) +bool VCardXXPort::exportContacts( const TDEABC::AddresseeList &addrList, const TQString &data ) { - KABC::VCardConverter converter; + TDEABC::VCardConverter converter; KURL url; - KABC::AddresseeList list; + TDEABC::AddresseeList list; list = filterContacts( addrList ); @@ -119,13 +119,13 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const TQS if ( data == "v21" ) #if defined(KABC_VCARD_ENCODING_FIX) - ok = doExport( url, converter.createVCardsRaw( list, KABC::VCardConverter::v2_1 ) ); + ok = doExport( url, converter.createVCardsRaw( list, TDEABC::VCardConverter::v2_1 ) ); else - ok = doExport( url, converter.createVCardsRaw( list, KABC::VCardConverter::v3_0 ) ); + ok = doExport( url, converter.createVCardsRaw( list, TDEABC::VCardConverter::v3_0 ) ); #else - ok = doExport( url, converter.createVCards( list, KABC::VCardConverter::v2_1 ) ); + ok = doExport( url, converter.createVCards( list, TDEABC::VCardConverter::v2_1 ) ); else - ok = doExport( url, converter.createVCards( list, KABC::VCardConverter::v3_0 ) ); + ok = doExport( url, converter.createVCards( list, TDEABC::VCardConverter::v3_0 ) ); #endif } else { TQString msg = i18n( "You have selected a list of contacts, shall they be " @@ -137,7 +137,7 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const TQS if ( baseUrl.isEmpty() ) return true; - KABC::AddresseeList::ConstIterator it; + TDEABC::AddresseeList::ConstIterator it; uint counter = 0; for ( it = list.begin(); it != list.end(); ++it ) { TQString testUrl; @@ -153,18 +153,18 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const TQS url = testUrl + ".vcf"; bool tmpOk; - KABC::AddresseeList tmpList; + TDEABC::AddresseeList tmpList; tmpList.append( *it ); if ( data == "v21" ) #if defined(KABC_VCARD_ENCODING_FIX) - tmpOk = doExport( url, converter.createVCardsRaw( tmpList, KABC::VCardConverter::v2_1 ) ); + tmpOk = doExport( url, converter.createVCardsRaw( tmpList, TDEABC::VCardConverter::v2_1 ) ); else - tmpOk = doExport( url, converter.createVCardsRaw( tmpList, KABC::VCardConverter::v3_0 ) ); + tmpOk = doExport( url, converter.createVCardsRaw( tmpList, TDEABC::VCardConverter::v3_0 ) ); #else - tmpOk = doExport( url, converter.createVCards( tmpList, KABC::VCardConverter::v2_1 ) ); + tmpOk = doExport( url, converter.createVCards( tmpList, TDEABC::VCardConverter::v2_1 ) ); else - tmpOk = doExport( url, converter.createVCards( tmpList, KABC::VCardConverter::v3_0 ) ); + tmpOk = doExport( url, converter.createVCards( tmpList, TDEABC::VCardConverter::v3_0 ) ); #endif ok = ok && tmpOk; } @@ -178,13 +178,13 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const TQS if ( data == "v21" ) #if defined(KABC_VCARD_ENCODING_FIX) - ok = doExport( url, converter.createVCardsRaw( list, KABC::VCardConverter::v2_1 ) ); + ok = doExport( url, converter.createVCardsRaw( list, TDEABC::VCardConverter::v2_1 ) ); else - ok = doExport( url, converter.createVCardsRaw( list, KABC::VCardConverter::v3_0 ) ); + ok = doExport( url, converter.createVCardsRaw( list, TDEABC::VCardConverter::v3_0 ) ); #else - ok = doExport( url, converter.createVCards( list, KABC::VCardConverter::v2_1 ) ); + ok = doExport( url, converter.createVCards( list, TDEABC::VCardConverter::v2_1 ) ); else - ok = doExport( url, converter.createVCards( list, KABC::VCardConverter::v3_0 ) ); + ok = doExport( url, converter.createVCards( list, TDEABC::VCardConverter::v3_0 ) ); #endif } } @@ -193,10 +193,10 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &addrList, const TQS return ok; } -KABC::AddresseeList VCardXXPort::importContacts( const TQString& ) const +TDEABC::AddresseeList VCardXXPort::importContacts( const TQString& ) const { TQString fileName; - KABC::AddresseeList addrList; + TDEABC::AddresseeList addrList; KURL::List urls; if ( !XXPortManager::importData.isEmpty() ) { @@ -283,9 +283,9 @@ KABC::AddresseeList VCardXXPort::importContacts( const TQString& ) const } #if defined(KABC_VCARD_ENCODING_FIX) -KABC::AddresseeList VCardXXPort::parseVCard( const TQByteArray &data ) const +TDEABC::AddresseeList VCardXXPort::parseVCard( const TQByteArray &data ) const { - KABC::VCardConverter converter; + TDEABC::VCardConverter converter; return converter.parseVCardsRaw( data.data() ); } @@ -305,9 +305,9 @@ bool VCardXXPort::doExport( const KURL &url, const TQByteArray &data ) return TDEIO::NetAccess::upload( tmpFile.name(), url, parentWidget() ); } #else -KABC::AddresseeList VCardXXPort::parseVCard( const TQString &data ) const +TDEABC::AddresseeList VCardXXPort::parseVCard( const TQString &data ) const { - KABC::VCardConverter converter; + TDEABC::VCardConverter converter; return converter.parseVCards( data ); } @@ -331,9 +331,9 @@ bool VCardXXPort::doExport( const KURL &url, const TQString &data ) } #endif -KABC::AddresseeList VCardXXPort::filterContacts( const KABC::AddresseeList &addrList ) +TDEABC::AddresseeList VCardXXPort::filterContacts( const TDEABC::AddresseeList &addrList ) { - KABC::AddresseeList list; + TDEABC::AddresseeList list; if ( addrList.isEmpty() ) return addrList; @@ -342,9 +342,9 @@ KABC::AddresseeList VCardXXPort::filterContacts( const KABC::AddresseeList &addr if ( !dlg.exec() ) return list; - KABC::AddresseeList::ConstIterator it; + TDEABC::AddresseeList::ConstIterator it; for ( it = addrList.begin(); it != addrList.end(); ++it ) { - KABC::Addressee addr; + TDEABC::Addressee addr; addr.setUid( (*it).uid() ); addr.setFormattedName( (*it).formattedName() ); @@ -378,38 +378,38 @@ KABC::AddresseeList VCardXXPort::filterContacts( const KABC::AddresseeList &addr addr.setLogo( (*it).logo() ); - KABC::PhoneNumber::List phones = (*it).phoneNumbers( KABC::PhoneNumber::Work ); - KABC::PhoneNumber::List::Iterator phoneIt; + TDEABC::PhoneNumber::List phones = (*it).phoneNumbers( TDEABC::PhoneNumber::Work ); + TDEABC::PhoneNumber::List::Iterator phoneIt; for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) addr.insertPhoneNumber( *phoneIt ); - KABC::Address::List addresses = (*it).addresses( KABC::Address::Work ); - KABC::Address::List::Iterator addrIt; + TDEABC::Address::List addresses = (*it).addresses( TDEABC::Address::Work ); + TDEABC::Address::List::Iterator addrIt; for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt ) addr.insertAddress( *addrIt ); } - KABC::PhoneNumber::List phones = (*it).phoneNumbers(); - KABC::PhoneNumber::List::Iterator phoneIt; + TDEABC::PhoneNumber::List phones = (*it).phoneNumbers(); + TDEABC::PhoneNumber::List::Iterator phoneIt; for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { int type = (*phoneIt).type(); - if ( type & KABC::PhoneNumber::Home && dlg.exportPrivateFields() ) + if ( type & TDEABC::PhoneNumber::Home && dlg.exportPrivateFields() ) addr.insertPhoneNumber( *phoneIt ); - else if ( type & KABC::PhoneNumber::Work && dlg.exportBusinessFields() ) + else if ( type & TDEABC::PhoneNumber::Work && dlg.exportBusinessFields() ) addr.insertPhoneNumber( *phoneIt ); else if ( dlg.exportOtherFields() ) addr.insertPhoneNumber( *phoneIt ); } - KABC::Address::List addresses = (*it).addresses(); - KABC::Address::List::Iterator addrIt; + TDEABC::Address::List addresses = (*it).addresses(); + TDEABC::Address::List::Iterator addrIt; for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt ) { int type = (*addrIt).type(); - if ( type & KABC::Address::Home && dlg.exportPrivateFields() ) + if ( type & TDEABC::Address::Home && dlg.exportPrivateFields() ) addr.insertAddress( *addrIt ); - else if ( type & KABC::Address::Work && dlg.exportBusinessFields() ) + else if ( type & TDEABC::Address::Work && dlg.exportBusinessFields() ) addr.insertAddress( *addrIt ); else if ( dlg.exportOtherFields() ) addr.insertAddress( *addrIt ); @@ -419,8 +419,8 @@ KABC::AddresseeList VCardXXPort::filterContacts( const KABC::AddresseeList &addr addr.setCustoms( (*it).customs() ); if ( dlg.exportEncryptionKeys() ) { - addKey( addr, KABC::Key::PGP ); - addKey( addr, KABC::Key::X509 ); + addKey( addr, TDEABC::Key::PGP ); + addKey( addr, TDEABC::Key::X509 ); } list.append( addr ); @@ -429,10 +429,10 @@ KABC::AddresseeList VCardXXPort::filterContacts( const KABC::AddresseeList &addr return list; } -void VCardXXPort::addKey( KABC::Addressee &addr, KABC::Key::Types type ) +void VCardXXPort::addKey( TDEABC::Addressee &addr, TDEABC::Key::Types type ) { TQString fingerprint = addr.custom( "KADDRESSBOOK", - (type == KABC::Key::PGP ? "OPENPGPFP" : "SMIMEFP") ); + (type == TDEABC::Key::PGP ? "OPENPGPFP" : "SMIMEFP") ); if ( fingerprint.isEmpty() ) return; @@ -455,7 +455,7 @@ void VCardXXPort::addKey( KABC::Addressee &addr, KABC::Key::Types type ) return; } - KABC::Key key; + TDEABC::Key key; key.setType( type ); key.setBinaryData( dataProvider.data() ); @@ -464,7 +464,7 @@ void VCardXXPort::addKey( KABC::Addressee &addr, KABC::Key::Types type ) // ---------- VCardViewer Dialog ---------------- // -VCardViewerDialog::VCardViewerDialog( const KABC::Addressee::List &list, +VCardViewerDialog::VCardViewerDialog( const TDEABC::Addressee::List &list, TQWidget *parent, const char *name ) : KDialogBase( Plain, i18n( "Import vCard" ), Yes | No | Apply | Cancel, Yes, parent, name, true, true, KStdGuiItem::no(), KStdGuiItem::yes() ), @@ -491,7 +491,7 @@ VCardViewerDialog::VCardViewerDialog( const KABC::Addressee::List &list, updateView(); } -KABC::Addressee::List VCardViewerDialog::contacts() const +TDEABC::Addressee::List VCardViewerDialog::contacts() const { return mContacts; } @@ -500,7 +500,7 @@ void VCardViewerDialog::updateView() { mView->setAddressee( *mIt ); - KABC::Addressee::List::Iterator it = mIt; + TDEABC::Addressee::List::Iterator it = mIt; actionButton( Apply )->setEnabled( (++it) != mContacts.end() ); } |