22 #include "recipientspicker.h"
24 #include "globalsettings.h"
26 #include <libtdepim/recentaddresses.h>
27 #include <libtdepim/ldapsearchdialog.h>
29 #include <libemailfunctions/email.h>
31 #ifndef TDEPIM_NEW_DISTRLISTS
32 #include <tdeabc/distributionlist.h>
35 #include <tdelistview.h>
36 #include <tdelocale.h>
37 #include <tdeabc/resource.h>
38 #include <kiconloader.h>
41 #include <tdemessagebox.h>
44 #include <tqcombobox.h>
45 #include <tqpushbutton.h>
46 #include <tqtoolbutton.h>
49 #ifdef TDEPIM_NEW_DISTRLISTS
50 RecipientItem::RecipientItem( TDEABC::AddressBook *ab )
55 RecipientItem::RecipientItem()
56 : mDistributionList( 0 )
61 #ifdef TDEPIM_NEW_DISTRLISTS
62 void RecipientItem::setDistributionList( KPIM::DistributionList &list )
64 mDistributionList = list;
66 mIcon = TDEGlobal::iconLoader()->loadIcon(
"tdmconfig", TDEIcon::Small );
71 int count = list.entries( mAddressBook ).count();
72 mEmail = i18n(
"1 email address",
"%n email addresses", count );
76 mTooltip = createTooltip( list );
79 void RecipientItem::setDistributionList( TDEABC::DistributionList *list )
81 mDistributionList = list;
83 mIcon = TDEGlobal::iconLoader()->loadIcon(
"tdmconfig", TDEIcon::Small );
88 int count = list->entries().count();
89 mEmail = i18n(
"1 email address",
"%n email addresses", count );
93 mTooltip = createTooltip( list );
97 void RecipientItem::setAddressee(
const TDEABC::Addressee &a,
98 const TQString &email )
102 mRecipient = mAddressee.fullEmail( mEmail );
104 TQImage img = a.photo().data();
106 mIcon = img.smoothScale( 20, 20, TQImage::ScaleMin );
108 mIcon = TDEGlobal::iconLoader()->loadIcon(
"preferences-desktop-personal", TDEIcon::Small );
110 mName = mAddressee.realName();
111 mKey = mAddressee.realName() +
'|' + mEmail;
114 if ( !mAddressee.realName().isEmpty() ) {
115 mTooltip += mAddressee.realName() +
"<br/>";
117 mTooltip +=
"<b>" + mEmail +
"</b>";
120 TQPixmap RecipientItem::icon()
const
125 TQString RecipientItem::name()
const
130 TQString RecipientItem::email()
const
135 TQString RecipientItem::recipient()
const
140 TQString RecipientItem::tooltip()
const
145 #ifdef TDEPIM_NEW_DISTRLISTS
146 KPIM::DistributionList& RecipientItem::distributionList() {
147 return mDistributionList;
150 TDEABC::DistributionList * RecipientItem::distributionList() {
151 return mDistributionList;
155 #ifdef TDEPIM_NEW_DISTRLISTS
156 TQString RecipientItem::createTooltip( KPIM::DistributionList &distributionList )
const
158 TQString txt =
"<qt>";
160 txt +=
"<b>" + i18n(
"Distribution List %1" ).arg ( distributionList.name() ) +
"</b>";
162 KPIM::DistributionList::Entry::List entries = distributionList.entries( mAddressBook );
163 KPIM::DistributionList::Entry::List::ConstIterator it;
164 for( it = entries.begin(); it != entries.end(); ++it ) {
166 txt += (*it).addressee.realName() +
' ';
168 if ( (*it).email.isEmpty() ) txt += (*it).addressee.preferredEmail();
169 else txt += (*it).email;
179 TQString RecipientItem::createTooltip( TDEABC::DistributionList *distributionList )
const
181 TQString txt =
"<qt>";
183 txt +=
"<b>" + i18n(
"Distribution List %1" ).arg ( distributionList->name() ) +
"</b>";
185 TDEABC::DistributionList::Entry::List entries = distributionList->entries();
186 TDEABC::DistributionList::Entry::List::ConstIterator it;
187 for( it = entries.begin(); it != entries.end(); ++it ) {
189 txt += (*it).addressee.realName() +
' ';
191 if ( (*it).email.isEmpty() ) txt += (*it).addressee.preferredEmail();
192 else txt += (*it).email;
203 void RecipientItem::setRecipientType(
const TQString &type )
208 TQString RecipientItem::recipientType()
const
214 RecipientViewItem::RecipientViewItem( RecipientItem *item, TDEListView *listView )
215 : TDEListViewItem( listView ), mRecipientItem( item )
217 setText( 0, item->recipientType() );
218 setText( 1, item->name() );
219 setText( 2, item->email() );
221 setPixmap( 1, item->icon() );
224 RecipientItem *RecipientViewItem::recipientItem()
const
226 return mRecipientItem;
230 RecipientsListToolTip::RecipientsListToolTip( TQWidget *parent,
231 TDEListView *listView )
232 : TQToolTip( parent )
234 mListView = listView;
237 void RecipientsListToolTip::maybeTip(
const TQPoint & pos )
240 TQListViewItem *item = mListView->itemAt( pos );
241 RecipientViewItem *i =
static_cast<RecipientViewItem *
>( item );
244 r = mListView->itemRect( item );
245 TQString tipText( i->recipientItem()->tooltip() );
246 if ( !tipText.isEmpty() ) {
253 RecipientsCollection::RecipientsCollection(
const TQString &
id )
257 mIsReferenceContainer =
false;
260 RecipientsCollection::~RecipientsCollection()
265 void RecipientsCollection::setReferenceContainer(
bool isReferenceContainer )
267 mIsReferenceContainer = isReferenceContainer;
270 bool RecipientsCollection::isReferenceContainer()
const
272 return mIsReferenceContainer;
275 void RecipientsCollection::setTitle(
const TQString &title )
280 TQString RecipientsCollection::title()
const
285 void RecipientsCollection::addItem( RecipientItem *item )
287 mKeyMap.insert( item->key(), item );
290 RecipientItem::List RecipientsCollection::items()
const
292 return mKeyMap.values();
295 bool RecipientsCollection::hasEquivalentItem( RecipientItem *item )
const
297 return mKeyMap.find( item->key() ) != mKeyMap.end();
300 RecipientItem * RecipientsCollection::getEquivalentItem( RecipientItem *item)
const
302 TQMap<TQString, RecipientItem *>::ConstIterator it;
303 it = mKeyMap.find( item->key() );
304 if ( it == mKeyMap.end() )
309 void RecipientsCollection::clear()
314 void RecipientsCollection::deleteAll()
316 if ( !isReferenceContainer() ) {
317 TQMap<TQString, RecipientItem *>::ConstIterator it;
318 for( it = mKeyMap.begin(); it != mKeyMap.end(); ++it ) {
325 TQString RecipientsCollection::id()
const
330 SearchLine::SearchLine( TQWidget *parent, TDEListView *listView )
331 : TDEListViewSearchLine( parent, listView )
335 void SearchLine::keyPressEvent( TQKeyEvent *ev )
337 if ( ev->key() == Key_Down ) emit downPressed();
339 TDEListViewSearchLine::keyPressEvent( ev );
343 RecipientsPicker::RecipientsPicker( TQWidget *parent )
344 : TQDialog( parent,
"RecipientsPicker" )
345 #ifndef TDEPIM_NEW_DISTRLISTS
346 , mDistributionListManager( 0 )
348 ,mLdapSearchDialog( 0 )
352 setCaption( i18n(
"Select Recipient") );
354 TQBoxLayout *topLayout =
new TQVBoxLayout(
this );
355 topLayout->setSpacing( KDialog::spacingHint() );
356 topLayout->setMargin( KDialog::marginHint() );
358 TQBoxLayout *resLayout =
new TQHBoxLayout( topLayout );
360 TQLabel *label =
new TQLabel( i18n(
"Address book:"),
this );
361 resLayout->addWidget( label );
363 mCollectionCombo =
new TQComboBox(
this );
364 resLayout->addWidget( mCollectionCombo );
365 resLayout->addItem(
new TQSpacerItem(1, 1, TQSizePolicy::Expanding));
369 connect( mCollectionCombo, TQ_SIGNAL( activated(
int ) ),
370 TQ_SLOT( updateList() ) );
372 TQBoxLayout *searchLayout =
new TQHBoxLayout( topLayout );
374 TQToolButton *button =
new TQToolButton(
this );
375 button->setIconSet( TDEGlobal::iconLoader()->loadIconSet(
376 TDEApplication::reverseLayout() ?
"clear_left":
"locationbar_erase", TDEIcon::Small, 0 ) );
377 searchLayout->addWidget( button );
378 connect( button, TQ_SIGNAL( clicked() ), TQ_SLOT( resetSearch() ) );
380 label =
new TQLabel( i18n(
"&Search:"),
this );
381 searchLayout->addWidget( label );
383 mRecipientList =
new TDEListView(
this );
384 mRecipientList->setSelectionMode( TQListView::Extended );
385 mRecipientList->setAllColumnsShowFocus(
true );
386 mRecipientList->setFullWidth(
true );
387 topLayout->addWidget( mRecipientList );
388 mRecipientList->addColumn( i18n(
"->") );
389 mRecipientList->addColumn( i18n(
"Name") );
390 mRecipientList->addColumn( i18n(
"Email") );
391 connect( mRecipientList, TQ_SIGNAL( doubleClicked( TQListViewItem *,
392 const TQPoint &,
int ) ), TQ_SLOT( slotPicked() ) );
393 connect( mRecipientList, TQ_SIGNAL( returnPressed( TQListViewItem * ) ),
394 TQ_SLOT( slotPicked() ) );
396 new RecipientsListToolTip( mRecipientList->viewport(), mRecipientList );
398 mSearchLine =
new SearchLine(
this, mRecipientList );
399 searchLayout->addWidget( mSearchLine );
400 label->setBuddy( label );
401 connect( mSearchLine, TQ_SIGNAL( downPressed() ), TQ_SLOT( setFocusList() ) );
403 mSearchLDAPButton =
new TQPushButton( i18n(
"Search &Directory Service"),
this );
404 searchLayout->addWidget( mSearchLDAPButton );
405 connect( mSearchLDAPButton, TQ_SIGNAL( clicked() ), TQ_SLOT( slotSearchLDAP() ) );
407 TQBoxLayout *buttonLayout =
new TQHBoxLayout( topLayout );
409 buttonLayout->addStretch( 1 );
411 mToButton =
new TQPushButton( i18n(
"Add as To"),
this );
412 buttonLayout->addWidget( mToButton );
413 connect( mToButton, TQ_SIGNAL( clicked() ), TQ_SLOT( slotToClicked() ) );
415 mCcButton =
new TQPushButton( i18n(
"Add as CC"),
this );
416 buttonLayout->addWidget( mCcButton );
417 connect( mCcButton, TQ_SIGNAL( clicked() ), TQ_SLOT( slotCcClicked() ) );
419 mBccButton =
new TQPushButton( i18n(
"Add as BCC"),
this );
420 buttonLayout->addWidget( mBccButton );
421 connect( mBccButton, TQ_SIGNAL( clicked() ), TQ_SLOT( slotBccClicked() ) );
425 TQPushButton *closeButton =
new TQPushButton( i18n(
"&Cancel"),
this );
426 buttonLayout->addWidget( closeButton );
427 connect( closeButton, TQ_SIGNAL( clicked() ), TQ_SLOT( close() ) );
430 using namespace TDEABC;
431 mAddressBook = TDEABC::StdAddressBook::self(
true );
432 connect( mAddressBook, TQ_SIGNAL( addressBookChanged( AddressBook * ) ),
433 this, TQ_SLOT( insertAddressBook( AddressBook * ) ) );
438 mCollectionCombo->setCurrentItem( 0 );
442 mSearchLine->setFocus();
446 setTabOrder( mCollectionCombo, mSearchLine );
447 setTabOrder( mSearchLine, mRecipientList );
448 setTabOrder( closeButton, mCollectionCombo );
451 RecipientsPicker::~RecipientsPicker()
455 #ifndef TDEPIM_NEW_DISTRLISTS
456 delete mDistributionListManager;
459 TQMap<int,RecipientsCollection *>::ConstIterator it;
460 for( it = mCollectionMap.begin(); it != mCollectionMap.end(); ++it ) {
465 void RecipientsPicker::initCollections()
467 mAllRecipients =
new RecipientsCollection( i18n(
"All") );
468 mAllRecipients->setReferenceContainer(
true );
469 mDistributionLists =
new RecipientsCollection( i18n(
"Distribution Lists") );
470 mSelectedRecipients =
new RecipientsCollection( i18n(
"Selected Recipients") );
472 insertCollection( mAllRecipients );
473 insertAddressBook( mAddressBook );
474 insertCollection( mDistributionLists );
475 insertRecentAddresses();
476 insertCollection( mSelectedRecipients );
478 rebuildAllRecipientsList();
481 void RecipientsPicker::insertAddressBook( TDEABC::AddressBook *addressbook )
483 TQMap<TDEABC::Resource *,RecipientsCollection *> collectionMap;
485 TQPtrList<TDEABC::Resource> resources = addressbook->resources();
486 TDEABC::Resource *res;
487 for( res = resources.first(); res; res = resources.next() ) {
488 RecipientsCollection *collection =
new RecipientsCollection( res->identifier() );
489 collectionMap.insert( res, collection );
490 collection->setTitle( res->resourceName() );
493 TQMap<TQString,RecipientsCollection *> categoryMap;
495 TDEABC::AddressBook::Iterator it;
496 for( it = addressbook->begin(); it != addressbook->end(); ++it ) {
497 TQStringList emails = (*it).emails();
498 TQStringList::ConstIterator it3;
499 for( it3 = emails.begin(); it3 != emails.end(); ++it3 ) {
500 #ifdef TDEPIM_NEW_DISTRLISTS
501 RecipientItem *item =
new RecipientItem( mAddressBook );
503 RecipientItem *item =
new RecipientItem;
505 item->setAddressee( *it, *it3 );
507 TQMap<TDEABC::Resource *,RecipientsCollection *>::ConstIterator collIt;
508 collIt = collectionMap.find( it->resource() );
509 if ( collIt != collectionMap.end() ) {
510 (*collIt)->addItem( item );
513 TQStringList categories = (*it).categories();
514 TQStringList::ConstIterator catIt;
515 for( catIt = categories.begin(); catIt != categories.end(); ++catIt ) {
516 TQMap<TQString, RecipientsCollection *>::ConstIterator catMapIt;
517 catMapIt = categoryMap.find( *catIt );
518 RecipientsCollection *collection;
519 if ( catMapIt == categoryMap.end() ) {
520 collection =
new RecipientsCollection( *catIt );
521 collection->setReferenceContainer(
true );
522 categoryMap.insert( *catIt, collection );
524 collection = *catMapIt;
526 collection->addItem( item );
531 TQMap<TDEABC::Resource *,RecipientsCollection *>::ConstIterator it2;
532 for( it2 = collectionMap.begin(); it2 != collectionMap.end(); ++it2 ) {
533 insertCollection( *it2 );
536 TQMap<TQString, RecipientsCollection *>::ConstIterator it3;
537 for( it3 = categoryMap.begin(); it3 != categoryMap.end(); ++it3 ) {
538 insertCollection( *it3 );
541 insertDistributionLists();
542 rebuildAllRecipientsList();
546 void RecipientsPicker::insertDistributionLists()
548 mDistributionLists->deleteAll();
550 #ifdef TDEPIM_NEW_DISTRLISTS
551 TQValueList<KPIM::DistributionList> lists = KPIM::DistributionList::allDistributionLists( mAddressBook );
552 for ( uint i = 0; i < lists.count(); ++i ) {
553 RecipientItem *item =
new RecipientItem( mAddressBook );
554 item->setDistributionList( lists[ i ] );
555 mDistributionLists->addItem( item );
558 delete mDistributionListManager;
559 mDistributionListManager =
560 new TDEABC::DistributionListManager( TDEABC::StdAddressBook::self(
true ) );
562 mDistributionListManager->load();
564 TQStringList lists = mDistributionListManager->listNames();
566 TQStringList::Iterator listIt;
567 for ( listIt = lists.begin(); listIt != lists.end(); ++listIt ) {
568 TDEABC::DistributionList *list = mDistributionListManager->list( *listIt );
569 RecipientItem *item =
new RecipientItem;
570 item->setDistributionList( list );
571 mDistributionLists->addItem( item );
576 void RecipientsPicker::insertRecentAddresses()
578 RecipientsCollection *collection =
new RecipientsCollection( i18n(
"Recent Addresses") );
580 TDEConfig config(
"kmailrc" );
581 TDEABC::Addressee::List recents =
582 TDERecentAddress::RecentAddresses::self( &config )->tdeabcAddresses();
584 TDEABC::Addressee::List::ConstIterator it;
585 for( it = recents.begin(); it != recents.end(); ++it ) {
586 #ifdef TDEPIM_NEW_DISTRLISTS
587 RecipientItem *item =
new RecipientItem( mAddressBook );
589 RecipientItem *item =
new RecipientItem;
591 item->setAddressee( *it, (*it).preferredEmail() );
592 collection->addItem( item );
595 insertCollection( collection );
598 void RecipientsPicker::insertCollection( RecipientsCollection *coll )
601 TQMap<int,RecipientsCollection *>::ConstIterator it;
602 for ( it = mCollectionMap.begin(); it != mCollectionMap.end(); ++it ) {
603 if ( (*it)->id() == coll->id() ) {
605 mCollectionMap.remove( index );
606 mCollectionMap.insert( index, coll );
612 mCollectionCombo->insertItem( coll->title(), index );
613 mCollectionMap.insert( index, coll );
616 void RecipientsPicker::updateRecipient(
const Recipient &recipient )
618 RecipientItem::List allRecipients = mAllRecipients->items();
619 RecipientItem::List::ConstIterator itAll;
620 for( itAll = allRecipients.begin(); itAll != allRecipients.end(); ++itAll ) {
621 if ( (*itAll)->recipient() == recipient.email() ) {
622 (*itAll)->setRecipientType( recipient.typeLabel() );
628 void RecipientsPicker::setRecipients(
const Recipient::List &recipients )
630 mSelectedRecipients->deleteAll();
632 Recipient::List::ConstIterator it;
633 for( it = recipients.begin(); it != recipients.end(); ++it ) {
634 RecipientItem *item = 0;
638 RecipientItem::List items = mDistributionLists->items();
639 RecipientItem::List::ConstIterator distIt;
640 #ifdef TDEPIM_NEW_DISTRLISTS
641 for ( distIt = items.begin(); distIt != items.end(); ++distIt ) {
642 if ( (*it).email() == (*distIt)->name() ) {
643 item =
new RecipientItem( mAddressBook );
644 item->setDistributionList( (*distIt)->distributionList() );
648 for ( distIt = items.begin(); distIt != items.end(); ++distIt ) {
649 if ( (*it).email() == (*distIt)->name() ) {
650 item =
new RecipientItem();
651 item->setDistributionList( (*distIt)->distributionList() );
660 TDEABC::Addressee::parseEmailAddress( (*it).email(), name, email );
661 a.setNameFromString( name );
662 a.insertEmail( email );
664 #ifdef TDEPIM_NEW_DISTRLISTS
665 item =
new RecipientItem( mAddressBook );
667 item =
new RecipientItem;
669 item->setAddressee( a, a.preferredEmail() );
672 item->setRecipientType( (*it).typeLabel() );
673 mSelectedRecipients->addItem( item );
679 void RecipientsPicker::setDefaultButton( TQPushButton *button )
682 button->setDefault(
true );
685 void RecipientsPicker::setDefaultType( Recipient::Type type )
689 if ( type == Recipient::To ) {
690 setDefaultButton( mToButton );
691 }
else if ( type == Recipient::Cc ) {
692 setDefaultButton( mCcButton );
693 }
else if ( type == Recipient::Bcc ) {
694 setDefaultButton( mBccButton );
698 void RecipientsPicker::rebuildAllRecipientsList()
700 mAllRecipients->clear();
702 TQMap<int,RecipientsCollection *>::ConstIterator it;
703 for( it = mCollectionMap.begin(); it != mCollectionMap.end(); ++it ) {
705 if ( (*it) == mAllRecipients )
708 RecipientItem::List coll = (*it)->items();
710 RecipientItem::List::ConstIterator rcptIt;
711 for ( rcptIt = coll.begin(); rcptIt != coll.end(); ++rcptIt ) {
712 mAllRecipients->addItem( *rcptIt );
717 void RecipientsPicker::updateList()
719 mRecipientList->clear();
721 RecipientsCollection *coll = mCollectionMap[ mCollectionCombo->currentItem() ];
723 RecipientItem::List items = coll->items();
724 RecipientItem::List::ConstIterator it;
725 for( it = items.begin(); it != items.end(); ++it ) {
726 if ( coll != mSelectedRecipients ) {
727 RecipientItem *selItem = mSelectedRecipients->getEquivalentItem( *it );
729 (*it)->setRecipientType( selItem->recipientType() );
731 (*it)->setRecipientType( TQString() );
734 new RecipientViewItem( *it, mRecipientList );
737 mSearchLine->updateSearch();
740 void RecipientsPicker::slotToClicked()
742 pick( Recipient::To );
745 void RecipientsPicker::slotCcClicked()
747 pick( Recipient::Cc );
750 void RecipientsPicker::slotBccClicked()
752 pick( Recipient::Bcc );
755 void RecipientsPicker::slotPicked( TQListViewItem *viewItem )
757 RecipientViewItem *item =
static_cast<RecipientViewItem *
>( viewItem );
759 RecipientItem *i = item->recipientItem();
760 emit pickedRecipient( Recipient( i->recipient(), Recipient::Undefined ) );
765 void RecipientsPicker::slotPicked()
767 pick( mDefaultType );
770 void RecipientsPicker::pick( Recipient::Type type )
772 kdDebug() <<
"RecipientsPicker::pick " << int( type ) << endl;
775 TQListViewItemIterator it( mRecipientList ,
776 TQListViewItemIterator::Visible | TQListViewItemIterator::Selected );
777 for ( ; it.current(); ++it )
780 if ( count > GlobalSettings::self()->maximumRecipients() ) {
781 KMessageBox::sorry(
this,
782 i18n(
"You selected 1 recipient. The maximum supported number of "
783 "recipients is %1. Please adapt the selection.",
784 "You selected %n recipients. The maximum supported number of "
785 "recipients is %1. Please adapt the selection.", count)
786 .arg( GlobalSettings::self()->maximumRecipients() ) );
790 it = TQListViewItemIterator( mRecipientList ,
791 TQListViewItemIterator::Visible | TQListViewItemIterator::Selected );
792 for ( ; it.current(); ++it ) {
793 RecipientViewItem *item =
static_cast<RecipientViewItem *
>( it.current() );
795 RecipientItem *i = item->recipientItem();
796 Recipient r = i->recipient();
798 emit pickedRecipient( r );
804 void RecipientsPicker::keyPressEvent( TQKeyEvent *ev )
806 if ( ev->key() == Key_Escape ) close();
808 TQWidget::keyPressEvent( ev );
811 void RecipientsPicker::readConfig()
813 TDEConfig *cfg = TDEGlobal::config();
814 cfg->setGroup(
"RecipientsPicker" );
815 TQSize size = cfg->readSizeEntry(
"Size" );
816 if ( !size.isEmpty() ) {
819 int currentCollection = cfg->readNumEntry(
"CurrentCollection", -1 );
820 if ( currentCollection >= 0 &&
821 currentCollection < mCollectionCombo->count() ) {
822 mCollectionCombo->setCurrentItem( currentCollection );
826 void RecipientsPicker::writeConfig()
828 TDEConfig *cfg = TDEGlobal::config();
829 cfg->setGroup(
"RecipientsPicker" );
830 cfg->writeEntry(
"Size", size() );
831 cfg->writeEntry(
"CurrentCollection", mCollectionCombo->currentItem() );
834 void RecipientsPicker::setFocusList()
836 mRecipientList->setFocus();
839 void RecipientsPicker::resetSearch()
841 mSearchLine->setText( TQString() );
844 void RecipientsPicker::slotSearchLDAP()
846 if ( !mLdapSearchDialog ) {
847 mLdapSearchDialog =
new KPIM::LDAPSearchDialog(
this );
848 connect( mLdapSearchDialog, TQ_SIGNAL( addresseesAdded() ),
849 TQ_SLOT(ldapSearchResult() ) );
851 mLdapSearchDialog->setSearchText( mSearchLine->text() );
852 mLdapSearchDialog->show();
856 void RecipientsPicker::ldapSearchResult()
858 TQStringList emails = KPIM::splitEmailAddrList( mLdapSearchDialog->selectedEMails() );
859 TQStringList::iterator it( emails.begin() );
860 TQStringList::iterator end( emails.end() );
861 for ( ; it != end; ++it ){
864 KPIM::getNameAndMail( (*it), name, email );
865 TDEABC::Addressee ad;
866 ad.setNameFromString( name );
867 ad.insertEmail( email );
868 #ifdef TDEPIM_NEW_DISTRLISTS
869 RecipientItem *item =
new RecipientItem( mAddressBook );
871 RecipientItem *item =
new RecipientItem;
873 item->setAddressee( ad, ad.preferredEmail() );
874 emit pickedRecipient( Recipient( item->recipient(), Recipient::Undefined ) );
878 #include "recipientspicker.moc"