Bug 331154 r=annie.sullivan Make result nodes update when folder titles change.

This commit is contained in:
brettw%gmail.com 2006-03-23 20:30:59 +00:00
Родитель 693b88bfd3
Коммит 70c0fa65bf
1 изменённых файлов: 12 добавлений и 3 удалений

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

@ -2990,11 +2990,19 @@ NS_IMETHODIMP
nsNavHistoryFolderResultNode::OnFolderChanged(PRInt64 aFolder, nsNavHistoryFolderResultNode::OnFolderChanged(PRInt64 aFolder,
const nsACString& property) const nsACString& property)
{ {
if (! StartIncrementalUpdate()) // Do NOT call StartIncrementalUpdate here. That call is not appropriate
return NS_OK; // because it assumes a child has changed. Here, our folder itself is
// changing. Updating a folder is very easy and isn't affected by filtering,
// so we can always do incremental updates.
if (property.EqualsLiteral("title")) { if (property.EqualsLiteral("title")) {
mTitle = property; nsNavBookmarks* bookmarks = nsNavBookmarks::GetBookmarksService();
NS_ENSURE_TRUE(bookmarks, NS_ERROR_OUT_OF_MEMORY);
nsAutoString title;
bookmarks->GetFolderTitle(mFolderId, title);
mTitle = NS_ConvertUTF16toUTF8(title);
PRInt32 sortType = GetSortType(); PRInt32 sortType = GetSortType();
if ((sortType == nsINavHistoryQueryOptions::SORT_BY_TITLE_ASCENDING || if ((sortType == nsINavHistoryQueryOptions::SORT_BY_TITLE_ASCENDING ||
sortType == nsINavHistoryQueryOptions::SORT_BY_TITLE_DESCENDING) && sortType == nsINavHistoryQueryOptions::SORT_BY_TITLE_DESCENDING) &&
@ -3024,6 +3032,7 @@ nsNavHistoryFolderResultNode::OnFolderChanged(PRInt64 aFolder,
return NS_OK; return NS_OK;
} }
// nsNavHistoryFolderResultNode::OnSeparatorAdded (nsINavBookmarkObserver) // nsNavHistoryFolderResultNode::OnSeparatorAdded (nsINavBookmarkObserver)
NS_IMETHODIMP NS_IMETHODIMP