diff options
Diffstat (limited to 'libtdepim/addressesdialog.cpp')
-rw-r--r-- | libtdepim/addressesdialog.cpp | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/libtdepim/addressesdialog.cpp b/libtdepim/addressesdialog.cpp index aa52f4625..3083cdf46 100644 --- a/libtdepim/addressesdialog.cpp +++ b/libtdepim/addressesdialog.cpp @@ -61,9 +61,9 @@ namespace KPIM { // private start : struct AddresseeViewItem::AddresseeViewItemPrivate { - KABC::Addressee address; + TDEABC::Addressee address; AddresseeViewItem::Category category; - KABC::Addressee::List addresses; + TDEABC::Addressee::List addresses; }; struct AddressesDialog::AddressesDialogPrivate { @@ -86,12 +86,12 @@ struct AddressesDialog::AddressesDialogPrivate { TQDict<AddresseeViewItem> groupDict; - KABC::Addressee::List recentAddresses; + TDEABC::Addressee::List recentAddresses; LDAPSearchDialog *ldapSearchDialog; }; // privates end -AddresseeViewItem::AddresseeViewItem( AddresseeViewItem *parent, const KABC::Addressee& addr, +AddresseeViewItem::AddresseeViewItem( AddresseeViewItem *parent, const TDEABC::Addressee& addr, int emailIndex ) : TQObject( 0 ), TDEListViewItem( parent, addr.realName(), ( emailIndex == 0 ? addr.preferredEmail() : addr.emails()[ emailIndex ] ) ) @@ -121,7 +121,7 @@ AddresseeViewItem::AddresseeViewItem( TDEListView *lv, const TQString& name, Cat } AddresseeViewItem::AddresseeViewItem( AddresseeViewItem *parent, const TQString& name, - const KABC::Addressee::List &lst ) + const TDEABC::Addressee::List &lst ) : TQObject(0), TDEListViewItem( parent, name, i18n("<group>") ) { d = new AddresseeViewItemPrivate; @@ -144,13 +144,13 @@ AddresseeViewItem::~AddresseeViewItem() d = 0; } -KABC::Addressee +TDEABC::Addressee AddresseeViewItem::addressee() const { return d->address; } -KABC::Addressee::List +TDEABC::Addressee::List AddresseeViewItem::addresses() const { return d->addresses; @@ -220,7 +220,7 @@ AddressesDialog::AddressesDialog( TQWidget *widget, const char *name ) d = new AddressesDialogPrivate; d->ui = new AddressPickerUI( page ); - KABC::StdAddressBook::self( true ); + TDEABC::StdAddressBook::self( true ); updateAvailableAddressees(); initConnections(); @@ -274,8 +274,8 @@ AddressesDialog::setSelectedTo( const TQStringList& l ) { TQString name, email; for ( TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) { - KABC::Addressee addr; - KABC::Addressee::parseEmailAddress( *it, name, email ); + TDEABC::Addressee addr; + TDEABC::Addressee::parseEmailAddress( *it, name, email ); addr.setNameFromString( name ); addr.insertEmail( email ); addAddresseeToSelected( addr, selectedToItem() ); @@ -287,8 +287,8 @@ AddressesDialog::setSelectedCC( const TQStringList& l ) { TQString name, email; for ( TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) { - KABC::Addressee addr; - KABC::Addressee::parseEmailAddress( *it, name, email ); + TDEABC::Addressee addr; + TDEABC::Addressee::parseEmailAddress( *it, name, email ); addr.setNameFromString( name ); addr.insertEmail( email ); addAddresseeToSelected( addr, selectedCcItem() ); @@ -300,8 +300,8 @@ AddressesDialog::setSelectedBCC( const TQStringList& l ) { TQString name, email; for ( TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) { - KABC::Addressee addr; - KABC::Addressee::parseEmailAddress( *it, name, email ); + TDEABC::Addressee addr; + TDEABC::Addressee::parseEmailAddress( *it, name, email ); addr.setNameFromString( name ); addr.insertEmail( email ); addAddresseeToSelected( addr, selectedBccItem() ); @@ -309,7 +309,7 @@ AddressesDialog::setSelectedBCC( const TQStringList& l ) } void -AddressesDialog::setRecentAddresses( const KABC::Addressee::List& list ) +AddressesDialog::setRecentAddresses( const TDEABC::Addressee::List& list ) { d->recentAddresses = list; @@ -331,7 +331,7 @@ AddressesDialog::updateRecentAddresses() d->groupDict.insert( recentGroup, d->recent ); } - KABC::Addressee::List::ConstIterator it; + TDEABC::Addressee::List::ConstIterator it; for ( it = d->recentAddresses.begin(); it != d->recentAddresses.end(); ++it ) addAddresseeToAvailable( *it, d->recent ); @@ -357,7 +357,7 @@ TQStringList AddressesDialog::to() const { TQStringList emails = allDistributionLists( d->toItem ); - KABC::Addressee::List l = toAddresses(); + TDEABC::Addressee::List l = toAddresses(); emails += entryToString( l ); return emails; @@ -367,7 +367,7 @@ TQStringList AddressesDialog::cc() const { TQStringList emails = allDistributionLists( d->ccItem ); - KABC::Addressee::List l = ccAddresses(); + TDEABC::Addressee::List l = ccAddresses(); emails += entryToString( l ); return emails; @@ -378,43 +378,43 @@ AddressesDialog::bcc() const { TQStringList emails = allDistributionLists( d->bccItem ); - KABC::Addressee::List l = bccAddresses(); + TDEABC::Addressee::List l = bccAddresses(); emails += entryToString( l ); return emails; } -KABC::Addressee::List +TDEABC::Addressee::List AddressesDialog::toAddresses() const { return allAddressee( d->toItem ); } -KABC::Addressee::List +TDEABC::Addressee::List AddressesDialog::allToAddressesNoDuplicates() const { - KABC::Addressee::List aList = allAddressee( d->toItem ); + TDEABC::Addressee::List aList = allAddressee( d->toItem ); const TQStringList dList = toDistributionLists(); - KABC::AddressBook* abook = KABC::StdAddressBook::self( true ); + TDEABC::AddressBook* abook = TDEABC::StdAddressBook::self( true ); #ifdef TDEPIM_NEW_DISTRLISTS for ( TQStringList::ConstIterator it = dList.begin(); it != dList.end(); ++it ) { const TQValueList<KPIM::DistributionList::Entry> eList = KPIM::DistributionList::findByName(abook, *it).entries(abook); TQValueList<KPIM::DistributionList::Entry>::ConstIterator eit; for( eit = eList.begin(); eit != eList.end(); ++eit ) { - KABC::Addressee a = (*eit).addressee; + TDEABC::Addressee a = (*eit).addressee; if ( !a.preferredEmail().isEmpty() && aList.find( a ) == aList.end() ) { aList.append( a ) ; } } } #else - KABC::DistributionListManager manager( abook ); + TDEABC::DistributionListManager manager( abook ); manager.load(); for ( TQStringList::ConstIterator it = dList.begin(); it != dList.end(); ++it ) { - const TQValueList<KABC::DistributionList::Entry> eList = manager.list( *it )->entries(); - TQValueList<KABC::DistributionList::Entry>::ConstIterator eit; + const TQValueList<TDEABC::DistributionList::Entry> eList = manager.list( *it )->entries(); + TQValueList<TDEABC::DistributionList::Entry>::ConstIterator eit; for( eit = eList.begin(); eit != eList.end(); ++eit ) { - KABC::Addressee a = (*eit).addressee; + TDEABC::Addressee a = (*eit).addressee; if ( !a.preferredEmail().isEmpty() && aList.find( a ) == aList.end() ) { aList.append( a ) ; } @@ -424,13 +424,13 @@ AddressesDialog::allToAddressesNoDuplicates() const return aList; } -KABC::Addressee::List +TDEABC::Addressee::List AddressesDialog::ccAddresses() const { return allAddressee( d->ccItem ); } -KABC::Addressee::List +TDEABC::Addressee::List AddressesDialog::bccAddresses() const { return allAddressee( d->bccItem ); @@ -469,8 +469,8 @@ AddressesDialog::updateAvailableAddressees() d->personal->setVisible( false ); d->groupDict.insert( personalGroup, d->personal ); - KABC::AddressBook *addressBook = KABC::StdAddressBook::self( true ); - for( KABC::AddressBook::Iterator it = addressBook->begin(); + TDEABC::AddressBook *addressBook = TDEABC::StdAddressBook::self( true ); + for( TDEABC::AddressBook::Iterator it = addressBook->begin(); it != addressBook->end(); ++it ) { addAddresseeToAvailable( *it, d->personal ); } @@ -594,16 +594,16 @@ AddressesDialog::initConnections() TQT_SLOT(removeEntry()) ); #ifndef TDEPIM_NEW_DISTRLISTS - connect( KABC::DistributionListWatcher::self(), TQT_SIGNAL( changed() ), + connect( TDEABC::DistributionListWatcher::self(), TQT_SIGNAL( changed() ), this, TQT_SLOT( updateAvailableAddressees() ) ); #endif - connect( KABC::StdAddressBook::self( true ), TQT_SIGNAL( addressBookChanged(AddressBook*) ), + connect( TDEABC::StdAddressBook::self( true ), TQT_SIGNAL( addressBookChanged(AddressBook*) ), this, TQT_SLOT( updateAvailableAddressees() ) ); } void -AddressesDialog::addAddresseeToAvailable( const KABC::Addressee& addr, AddresseeViewItem* defaultParent, bool useCategory ) +AddressesDialog::addAddresseeToAvailable( const TDEABC::Addressee& addr, AddresseeViewItem* defaultParent, bool useCategory ) { if ( addr.preferredEmail().isEmpty() ) return; @@ -640,7 +640,7 @@ AddressesDialog::addAddresseeToAvailable( const KABC::Addressee& addr, Addressee } void -AddressesDialog::addAddresseeToSelected( const KABC::Addressee& addr, AddresseeViewItem* defaultParent ) +AddressesDialog::addAddresseeToSelected( const TDEABC::Addressee& addr, AddresseeViewItem* defaultParent ) { if ( addr.preferredEmail().isEmpty() ) return; @@ -709,11 +709,11 @@ AddressesDialog::addAddresseesToSelected( AddresseeViewItem *parent, } TQStringList -AddressesDialog::entryToString( const KABC::Addressee::List& l ) const +AddressesDialog::entryToString( const TDEABC::Addressee::List& l ) const { TQStringList entries; - for( KABC::Addressee::List::ConstIterator it = l.begin(); it != l.end(); ++it ) { + for( TDEABC::Addressee::List::ConstIterator it = l.begin(); it != l.end(); ++it ) { entries += (*it).fullEmail(); } return entries; @@ -854,13 +854,13 @@ AddressesDialog::removeEntry() // copied from kabcore.cpp :( // KDE4: should be in libkabc I think -static KABC::Resource *requestResource( KABC::AddressBook* abook, TQWidget *parent ) +static TDEABC::Resource *requestResource( TDEABC::AddressBook* abook, TQWidget *parent ) { - TQPtrList<KABC::Resource> kabcResources = abook->resources(); + TQPtrList<TDEABC::Resource> kabcResources = abook->resources(); TQPtrList<KRES::Resource> kresResources; - TQPtrListIterator<KABC::Resource> resIt( kabcResources ); - KABC::Resource *resource; + TQPtrListIterator<TDEABC::Resource> resIt( kabcResources ); + TDEABC::Resource *resource; while ( ( resource = resIt.current() ) != 0 ) { ++resIt; if ( !resource->readOnly() ) { @@ -871,7 +871,7 @@ static KABC::Resource *requestResource( KABC::AddressBook* abook, TQWidget *pare } KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); - return static_cast<KABC::Resource*>( res ); + return static_cast<TDEABC::Resource*>( res ); } #endif @@ -879,7 +879,7 @@ void AddressesDialog::saveAs() { #ifndef TDEPIM_NEW_DISTRLISTS - KABC::DistributionListManager manager( KABC::StdAddressBook::self( true ) ); + TDEABC::DistributionListManager manager( TDEABC::StdAddressBook::self( true ) ); manager.load(); #endif @@ -901,7 +901,7 @@ AddressesDialog::saveAs() bool alreadyExists = false; #ifdef TDEPIM_NEW_DISTRLISTS - KABC::AddressBook* abook = KABC::StdAddressBook::self( true ); + TDEABC::AddressBook* abook = TDEABC::StdAddressBook::self( true ); KPIM::DistributionList dlist = KPIM::DistributionList::findByName( abook, name ); alreadyExists = !dlist.isEmpty(); #else @@ -917,22 +917,22 @@ AddressesDialog::saveAs() } #ifdef TDEPIM_NEW_DISTRLISTS - KABC::Resource* resource = requestResource( abook, this ); + TDEABC::Resource* resource = requestResource( abook, this ); if ( !resource ) return; dlist.setResource( resource ); dlist.setName( name ); - KABC::Addressee::List addrl = allAddressee( d->ui->mSelectedView, false ); - for ( KABC::Addressee::List::iterator itr = addrl.begin(); + TDEABC::Addressee::List addrl = allAddressee( d->ui->mSelectedView, false ); + for ( TDEABC::Addressee::List::iterator itr = addrl.begin(); itr != addrl.end(); ++itr ) { dlist.insertEntry( *itr ); } abook->insertAddressee( dlist ); #else - KABC::DistributionList *dlist = new KABC::DistributionList( &manager, name ); - KABC::Addressee::List addrl = allAddressee( d->ui->mSelectedView, false ); - for ( KABC::Addressee::List::iterator itr = addrl.begin(); + TDEABC::DistributionList *dlist = new TDEABC::DistributionList( &manager, name ); + TDEABC::Addressee::List addrl = allAddressee( d->ui->mSelectedView, false ); + for ( TDEABC::Addressee::List::iterator itr = addrl.begin(); itr != addrl.end(); ++itr ) { dlist->insertEntry( *itr ); } @@ -962,7 +962,7 @@ AddressesDialog::ldapSearchResult() TQString name; TQString email; KPIM::getNameAndMail( (*it), name, email ); - KABC::Addressee ad; + TDEABC::Addressee ad; ad.setNameFromString( name ); ad.insertEmail( email ); addAddresseeToSelected( ad, selectedToItem() ); @@ -1062,10 +1062,10 @@ AddressesDialog::filterChanged( const TQString& txt ) } } -KABC::Addressee::List +TDEABC::Addressee::List AddressesDialog::allAddressee( TDEListView* view, bool onlySelected ) const { - KABC::Addressee::List lst; + TDEABC::Addressee::List lst; TQListViewItemIterator it( view ); while ( it.current() ) { AddresseeViewItem* item = static_cast<AddresseeViewItem*>( it.current() ); @@ -1086,10 +1086,10 @@ AddressesDialog::allAddressee( TDEListView* view, bool onlySelected ) const return lst; } -KABC::Addressee::List +TDEABC::Addressee::List AddressesDialog::allAddressee( AddresseeViewItem* parent ) const { - KABC::Addressee::List lst; + TDEABC::Addressee::List lst; if ( !parent ) return lst; @@ -1133,13 +1133,13 @@ AddressesDialog::allDistributionLists( AddresseeViewItem* parent ) const void AddressesDialog::addDistributionLists() { - KABC::AddressBook* abook = KABC::StdAddressBook::self( true ); + TDEABC::AddressBook* abook = TDEABC::StdAddressBook::self( true ); #ifdef TDEPIM_NEW_DISTRLISTS const TQValueList<KPIM::DistributionList> distLists = KPIM::DistributionList::allDistributionLists( abook ); #else - KABC::DistributionListManager manager( abook ); + TDEABC::DistributionListManager manager( abook ); manager.load(); TQStringList distLists = manager.listNames(); @@ -1163,8 +1163,8 @@ AddressesDialog::addDistributionLists() KPIM::DistributionList dlist = *listIt; KPIM::DistributionList::Entry::List entries = dlist.entries(abook); #else - KABC::DistributionList& dlist = *manager.list( *listIt ); - KABC::DistributionList::Entry::List entries = dlist.entries(); + TDEABC::DistributionList& dlist = *manager.list( *listIt ); + TDEABC::DistributionList::Entry::List entries = dlist.entries(); #endif AddresseeViewItem *item = new AddresseeViewItem( d->topdist, dlist.name() ); @@ -1175,7 +1175,7 @@ AddressesDialog::addDistributionLists() #ifdef TDEPIM_NEW_DISTRLISTS KPIM::DistributionList::Entry::List::Iterator itemIt; #else - KABC::DistributionList::Entry::List::Iterator itemIt; + TDEABC::DistributionList::Entry::List::Iterator itemIt; #endif for ( itemIt = entries.begin(); itemIt != entries.end(); ++itemIt ) { addAddresseeToAvailable( (*itemIt).addressee, item, false ); |