rem: void KMAcctImap::postProcessNewMail( KMFolder * folder ) { disconnect( folder->storage(), SIGNAL(numUnreadMsgsChanged(KMFolder*)), this, SLOT(postProcessNewMail(KMFolder*)) );  if ( mMailCheckProgressItem ) { mMailCheckProgressItem->incCompletedItems(); mMailCheckProgressItem->updateProgress(); mMailCheckProgressItem->setStatus( folder->prettyURL() + i18n(" completed") ); } mCountRemainChecks--;   const QString folderId = folder->idString(); int newInFolder = folder->countUnread(); if ( mUnreadBeforeCheck.find( folderId ) != mUnreadBeforeCheck.end() ) newInFolder -= mUnreadBeforeCheck[folderId]; if ( newInFolder > 0 ) { addToNewInFolder( folderId, newInFolder ); mCountUnread += newInFolder; }   QValueListIterator<Q_UINT32> filterIt = mFilterSerNums.begin(); QValueList<Q_UINT32> inTransit;  while (filterIt != mFilterSerNums.end()) { int idx = -1; KMFolder *folder = 0; KMMessage *msg = 0; KMMsgDict::instance()->getLocation( *filterIt, &folder, &idx );   if ( !folder ) { mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) ); ++filterIt; continue; }  KMFolderImap *imapFolder = dynamic_cast<KMFolderImap*>(folder->storage()); if (!imapFolder || !imapFolder->folder()->isSystemFolder() || !(imapFolder->imapPath() == "/INBOX/") ) { mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) ); ++filterIt; continue; }  if (idx != -1) {  msg = folder->getMsg( idx ); if (!msg) { mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) ); ++filterIt; continue; }  if (msg->transferInProgress()) { inTransit.append( *filterIt ); ++filterIt; continue; } msg->setTransferInProgress(true); if ( !msg->isComplete() ) { FolderJob *job = folder->createJob(msg); connect(job, SIGNAL(messageRetrieved(KMMessage*)), SLOT(slotFilterMsg(KMMessage*))); job->start(); } else { mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) ); if (slotFilterMsg(msg) == 2) break; } } ++filterIt; } mFilterSerNums = inTransit;  if (mCountRemainChecks == 0) {  mCountLastUnread = 0;   bool showStatus = ( mCheckingSingleFolder && mCountUnread > 0 ) ? false : true; ImapAccountBase::postProcessNewMail( showStatus ); mUnreadBeforeCheck.clear(); mCheckingSingleFolder = false; } }
add: void postProcessNewMail( KMFolder * f ) { ImapAccountBase::postProcessNewMail( f ); }
context: void KMAcctImap::postProcessNewMail( KMFolder * folder ) {  disconnect( folder->storage(), SIGNAL(numUnreadMsgsChanged(KMFolder*)),              this, SLOT(postProcessNewMail(KMFolder*)) );  if ( mMailCheckProgressItem ) {    mMailCheckProgressItem->incCompletedItems();    mMailCheckProgressItem->updateProgress();    mMailCheckProgressItem->setStatus( folder->prettyURL() + i18n(" completed") );  }  mCountRemainChecks--;  // count the unread messages  const QString folderId = folder->idString();  int newInFolder = folder->countUnread();  if ( mUnreadBeforeCheck.find( folderId ) != mUnreadBeforeCheck.end() )    newInFolder -= mUnreadBeforeCheck[folderId];  if ( newInFolder > 0 ) {    addToNewInFolder( folderId, newInFolder );    mCountUnread += newInFolder;  }  // Filter messages  QValueListIterator<Q_UINT32> filterIt = mFilterSerNums.begin();  QValueList<Q_UINT32> inTransit;  while (filterIt != mFilterSerNums.end()) {    int idx = -1;    KMFolder *folder = 0;    KMMessage *msg = 0;    KMMsgDict::instance()->getLocation( *filterIt, &folder, &idx );    // It's possible that the message has been deleted or moved into a    // different folder, or that the serNum is stale    if ( !folder ) {      mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) );      ++filterIt;      continue;    }        KMFolderImap *imapFolder = dynamic_cast<KMFolderImap*>(folder->storage());    if (!imapFolder ||	!imapFolder->folder()->isSystemFolder() ||        !(imapFolder->imapPath() == "/INBOX/") ) { // sanity checking      mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) );      ++filterIt;      continue;    }    if (idx != -1) {      msg = folder->getMsg( idx );      if (!msg) { // sanity checking        mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) );        ++filterIt;        continue;      }	          if (msg->transferInProgress()) {        inTransit.append( *filterIt );        ++filterIt;        continue;      }      msg->setTransferInProgress(true);      if ( !msg->isComplete() ) {        FolderJob *job = folder->createJob(msg);        connect(job, SIGNAL(messageRetrieved(KMMessage*)),            SLOT(slotFilterMsg(KMMessage*)));        job->start();      } else {        mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) );        if (slotFilterMsg(msg) == 2) break;      }    }    ++filterIt;  }  mFilterSerNums = inTransit;    if (mCountRemainChecks == 0)  {    // all checks are done    mCountLastUnread = 0; // => mCountUnread - mCountLastUnread == new count    // when we check only one folder (=selected) and we have new mails    // then do not display a summary as the normal status message is better    bool showStatus = ( mCheckingSingleFolder && mCountUnread > 0 ) ? false : true;    ImapAccountBase::postProcessNewMail( showStatus );    mUnreadBeforeCheck.clear();    mCheckingSingleFolder = false;  }}