only send change notification for pending filtered messages if the count changed - performance tweak

This commit is contained in:
bienvenu%netscape.com 1999-11-18 02:36:22 +00:00
Родитель 098299e271
Коммит 829eb193d3
1 изменённых файлов: 18 добавлений и 13 удалений

Просмотреть файл

@ -990,23 +990,28 @@ PRInt32 nsMsgFolder::GetNumPendingTotalMessages()
void nsMsgFolder::ChangeNumPendingUnread(PRInt32 delta)
{
char *oldUnreadMessagesStr = PR_smprintf("%d", mNumUnreadMessages + mNumPendingUnreadMessages);
mNumPendingUnreadMessages += delta;
char *unreadMessagesStr = PR_smprintf("%d",mNumUnreadMessages + mNumPendingUnreadMessages);
NotifyPropertyChanged("TotalUnreadMessages", oldUnreadMessagesStr, unreadMessagesStr);
PR_smprintf_free(unreadMessagesStr);
PR_smprintf_free(oldUnreadMessagesStr);
if (delta)
{
char *oldUnreadMessagesStr = PR_smprintf("%d", mNumUnreadMessages + mNumPendingUnreadMessages);
mNumPendingUnreadMessages += delta;
char *unreadMessagesStr = PR_smprintf("%d",mNumUnreadMessages + mNumPendingUnreadMessages);
NotifyPropertyChanged("TotalUnreadMessages", oldUnreadMessagesStr, unreadMessagesStr);
PR_smprintf_free(unreadMessagesStr);
PR_smprintf_free(oldUnreadMessagesStr);
}
}
void nsMsgFolder::ChangeNumPendingTotalMessages(PRInt32 delta)
{
char *oldTotalMessagesStr = PR_smprintf("%d", mNumTotalMessages + mNumPendingTotalMessages);
mNumPendingTotalMessages += delta;
char *totalMessagesStr = PR_smprintf("%d",mNumTotalMessages + mNumPendingTotalMessages);
NotifyPropertyChanged("TotalMessages", oldTotalMessagesStr, totalMessagesStr);
PR_smprintf_free(totalMessagesStr);
PR_smprintf_free(oldTotalMessagesStr);
if (delta)
{
char *oldTotalMessagesStr = PR_smprintf("%d", mNumTotalMessages + mNumPendingTotalMessages);
mNumPendingTotalMessages += delta;
char *totalMessagesStr = PR_smprintf("%d",mNumTotalMessages + mNumPendingTotalMessages);
NotifyPropertyChanged("TotalMessages", oldTotalMessagesStr, totalMessagesStr);
PR_smprintf_free(totalMessagesStr);
PR_smprintf_free(oldTotalMessagesStr);
}
}
#ifdef HAVE_DB