162156 r=cavin sr=bienvenu get db only if you are doing db batching

This commit is contained in:
naving%netscape.com 2002-08-14 22:31:49 +00:00
Родитель 8534f3b7e1
Коммит ec04bf62ce
1 изменённых файлов: 5 добавлений и 3 удалений

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

@ -2560,14 +2560,16 @@ NS_IMETHODIMP nsMsgFolder::EnableNotifications(PRInt32 notificationType, PRBool
// we're probably doing something that should be batched.
nsCOMPtr <nsIMsgDatabase> database;
GetMsgDatabase(nsnull, getter_AddRefs(database));
if (dbBatching) //only if we do dbBatching we need to get db
GetMsgDatabase(nsnull, getter_AddRefs(database));
if (enable)
{
if (database && dbBatching)
if (database)
database->EndBatch();
UpdateSummaryTotals(PR_TRUE);
}
else if (database && dbBatching)
else if (database)
database->StartBatch();
return NS_OK;