void UserDetailsManager::requestDetails( const QStringList & dnList, bool onlyUnknown ) { // build a list of DNs that are not already subject to a pending request QStringList requestList; QValueListConstIterator<QString> end = dnList.end(); for ( QValueListConstIterator<QString> it = dnList.begin(); it != end; ++it ) { // don't request our own details if ( *it == m_client->userDN() ) break; // don't request details we already have unless the caller specified this if ( onlyUnknown && known( *it ) ) break; QStringList::Iterator found = m_pendingDNs.find( *it ); if ( found == m_pendingDNs.end() ) { m_client->debug( QString( "UserDetailsManager::requestDetails - including %1" ).arg( (*it) ) ); requestList.append( *it ); m_pendingDNs.append( *it ); } } if ( !requestList.empty() ) { GetDetailsTask * gdt = new GetDetailsTask( m_client->rootTask() ); gdt->userDNs( requestList ); connect( gdt, SIGNAL( gotContactUserDetails( const GroupWise::ContactDetails & ) ), SLOT( slotReceiveContactDetails( const GroupWise::ContactDetails & ) ) ); // TODO: connect to gdt's finished() signal, check for failures, expand gdt to maintain a list of not found DNs? gdt->go( true ); } else { m_client->debug( "UserDetailsManager::requestDetails - all requested contacts are already available or pending" ); } }
void UserDetailsManager::requestDetails( const QStringList & dnList, bool onlyUnknown ) { // build a list of DNs that are not already subject to a pending request QStringList requestList; QStringListIterator it( dnList ); while ( it.hasNext() ) { QString dn = it.next(); // don't request our own details if ( dn == m_client->userDN() ) break; // don't request details we already have unless the caller specified this if ( onlyUnknown && known( dn ) ) break; if ( !m_pendingDNs.contains( dn ) ) { m_client->debug( QString( "UserDetailsManager::requestDetails - including %1" ).arg( dn ) ); requestList.append( dn); m_pendingDNs.append( dn ); } } if ( !requestList.empty() ) { GetDetailsTask * gdt = new GetDetailsTask( m_client->rootTask() ); gdt->userDNs( requestList ); connect( gdt, SIGNAL(gotContactUserDetails(GroupWise::ContactDetails)), SLOT(slotReceiveContactDetails(GroupWise::ContactDetails)) ); // TODO: connect to gdt's finished() signal, check for failures, expand gdt to maintain a list of not found DNs? gdt->go( true ); } else { m_client->debug( "UserDetailsManager::requestDetails - all requested contacts are already available or pending" ); } }