PRBool nobodyIsVerified = PR_TRUE;  nsCOMPtr<nsIEnumerator> subFolders;  nsresult rv = parentFolder->GetSubFolders(getter_AddRefs(subFolders)); if(NS_SUCCEEDED(rv)) { nsAdapterEnumerator *simpleEnumerator =	new nsAdapterEnumerator(subFolders); if (simpleEnumerator == nsnull) return NS_ERROR_OUT_OF_MEMORY; PRBool moreFolders;  while (NS_SUCCEEDED(simpleEnumerator->HasMoreElements(&moreFolders)) && moreFolders && nobodyIsVerified) { nsCOMPtr<nsISupports> child; rv = simpleEnumerator->GetNext(getter_AddRefs(child)); if (NS_SUCCEEDED(rv) && child) { PRBool childVerified = PR_FALSE; nsCOMPtr <nsIMsgImapMailFolder> childImapFolder = do_QueryInterface(child, &rv); if (NS_SUCCEEDED(rv) && childImapFolder) { nsCOMPtr <nsIMsgFolder> childFolder = do_QueryInterface(child, &rv); rv = childImapFolder->GetVerifiedAsOnlineFolder(&childVerified); nobodyIsVerified = !childVerified && NoDescendentsAreVerified(childFolder); } } } delete simpleEnumerator; }  return nobodyIsVerified;
PRBool nobodyIsVerified = PR_TRUE;  nsCOMPtr<nsIEnumerator> subFolders;  nsresult rv = parentFolder->GetSubFolders(getter_AddRefs(subFolders)); if(NS_SUCCEEDED(rv)) { nsAdapterEnumerator *simpleEnumerator =	new nsAdapterEnumerator(subFolders); if (simpleEnumerator == nsnull) return NS_ERROR_OUT_OF_MEMORY; PRBool moreFolders;  while (NS_SUCCEEDED(simpleEnumerator->HasMoreElements(&moreFolders)) && moreFolders && nobodyIsVerified) { nsCOMPtr<nsISupports> child; rv = simpleEnumerator->GetNext(getter_AddRefs(child)); if (NS_SUCCEEDED(rv) && child) { PRBool childVerified = PR_FALSE; nsCOMPtr <nsIMsgImapMailFolder> childImapFolder = do_QueryInterface(child, &rv); if (NS_SUCCEEDED(rv) && childImapFolder) { nsCOMPtr <nsIFolder> childFolder = do_QueryInterface(child, &rv); rv = childImapFolder->GetVerifiedAsOnlineFolder(&childVerified); nobodyIsVerified = !childVerified && NoDescendentsAreVerified(childFolder); } } } delete simpleEnumerator; }  return nobodyIsVerified;
PRBool nsImapIncomingServer::NoDescendentsAreVerified(nsIMsgFolder *parentFolder){  PRBool nobodyIsVerified = PR_TRUE;    nsCOMPtr<nsIEnumerator> subFolders;    nsresult rv = parentFolder->GetSubFolders(getter_AddRefs(subFolders));  if(NS_SUCCEEDED(rv))  {    nsAdapterEnumerator *simpleEnumerator =	new nsAdapterEnumerator(subFolders);    if (simpleEnumerator == nsnull)      return NS_ERROR_OUT_OF_MEMORY;    PRBool moreFolders;        while (NS_SUCCEEDED(simpleEnumerator->HasMoreElements(&moreFolders)) && moreFolders && nobodyIsVerified)    {      nsCOMPtr<nsISupports> child;      rv = simpleEnumerator->GetNext(getter_AddRefs(child));      if (NS_SUCCEEDED(rv) && child)       {        PRBool childVerified = PR_FALSE;        nsCOMPtr <nsIMsgImapMailFolder> childImapFolder = do_QueryInterface(child, &rv);        if (NS_SUCCEEDED(rv) && childImapFolder)        {          nsCOMPtr <nsIMsgFolder> childFolder = do_QueryInterface(child, &rv);          rv = childImapFolder->GetVerifiedAsOnlineFolder(&childVerified);          nobodyIsVerified = !childVerified && NoDescendentsAreVerified(childFolder);        }      }    }    delete simpleEnumerator;  }    return nobodyIsVerified;}