From kde-commits Tue Apr 12 11:40:32 2005 From: Cornelius Schumacher Date: Tue, 12 Apr 2005 11:40:32 +0000 To: kde-commits Subject: KDE_3_4_BRANCH: kdepim/kmail Message-Id: <20050412114032.6F7E2633 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=111330604121433 CVS commit by cschumac: Show categories in recipients picker. M +23 -0 recipientspicker.cpp 1.22.2.1 --- kdepim/kmail/recipientspicker.cpp #1.22:1.22.2.1 @@ -362,4 +362,6 @@ void RecipientsPicker::initCollections() } + QMap categoryMap; + mAllRecipients = new RecipientsCollection; mAllRecipients->setTitle( i18n("All") ); @@ -379,4 +381,20 @@ void RecipientsPicker::initCollections() (*collIt)->addItem( item ); } + + QStringList categories = (*it).categories(); + QStringList::ConstIterator catIt; + for( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { + QMap::ConstIterator catMapIt; + catMapIt = categoryMap.find( *catIt ); + RecipientsCollection *collection; + if ( catMapIt == categoryMap.end() ) { + collection = new RecipientsCollection; + collection->setTitle( *catIt ); + categoryMap.insert( *catIt, collection ); + } else { + collection = *catMapIt; + } + collection->addItem( item ); + } } } @@ -389,4 +407,9 @@ void RecipientsPicker::initCollections() } + QMap::ConstIterator it3; + for( it3 = categoryMap.begin(); it3 != categoryMap.end(); ++it3 ) { + insertCollection( *it3 ); + } + insertDistributionLists();