Bug #168355 --> add capability of setting an array of search terms on a filter.

Don't assume we are saving to rules.dat, use the right leaf name for the final file
when saving filters.

r=navin
sr=bienvenu
This commit is contained in:
mscott%netscape.com 2002-09-12 23:52:11 +00:00
Родитель d22d1f297b
Коммит 4aa398e263
2 изменённых файлов: 13 добавлений и 1 удалений

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

@ -219,6 +219,12 @@ NS_IMETHODIMP nsMsgFilter::GetSearchTerms(nsISupportsArray **aResult)
return NS_OK;
}
NS_IMETHODIMP nsMsgFilter::SetSearchTerms(nsISupportsArray *aSearchList)
{
m_termList = aSearchList;
return NS_OK;
}
NS_IMETHODIMP nsMsgFilter::SetScope(nsIMsgSearchScopeTerm *aResult)
{
m_scope = aResult;

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

@ -170,7 +170,13 @@ NS_IMETHODIMP nsMsgFilterService::SaveFilterList(nsIMsgFilterList *filterList, n
nsXPIDLCString tmpFileName;
tmpFiltersFile->GetLeafName(getter_Copies(tmpFileName));
parentDir->AppendRelativeUnixPath(tmpFileName.get());
parentDir->Rename("rules.dat");
nsXPIDLCString finalLeafName;
filterFile->GetLeafName(getter_Copies(finalLeafName));
if (!finalLeafName.IsEmpty())
parentDir->Rename(finalLeafName);
else // fall back to rules.dat
parentDir->Rename("rules.dat");
tmpFiltersFile->Delete(PR_FALSE);
}