Bug #267672 --> Request: groups (when "group by sort") should have the number of read and unread emails

Patch originally by John slade <bugzilla@johnslade.co.uk>

sr=bienvenu
This commit is contained in:
scott%scott-macgregor.org 2005-08-15 23:14:20 +00:00
parent ea0b137dab
commit 57429ba6cc

View File

@ -625,6 +625,31 @@ NS_IMETHODIMP nsMsgGroupView::GetCellText(PRInt32 aRow, nsITreeColumn* aCol, nsA
NS_ASSERTION(PR_FALSE, "we don't sort by group for this type");
break;
}
if (groupThread)
{
// Get number of messages in group
nsAutoString formattedCountMsg;
PRUint32 numMsg = groupThread->NumRealChildren();
formattedCountMsg.AppendInt(numMsg);
// Get number of unread messages
nsAutoString formattedCountUnrMsg;
PRUint32 numUnrMsg = 0;
groupThread->GetNumUnreadChildren(&numUnrMsg);
formattedCountUnrMsg.AppendInt(numUnrMsg);
// Add text to header
aValue.Append(NS_LITERAL_STRING(" ("));
if (numUnrMsg)
{
aValue.Append(formattedCountUnrMsg);
aValue.Append(NS_LITERAL_STRING("/"));
}
aValue.Append(formattedCountMsg);
aValue.Append(NS_LITERAL_STRING(")"));
}
}
else if (colID[0] == 't')
{