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();