Bug 372647- regression: bookmarkFeedURI annotation is not set on the children of a live bookmark. r=dietrich.

This commit is contained in:
mozilla.mano%sent.com 2007-03-06 18:37:58 +00:00
parent ffa520357a
commit 47320fa4a5
2 changed files with 14 additions and 4 deletions

View File

@ -655,6 +655,7 @@ PlacesController.prototype = {
case Ci.nsINavHistoryResultNode.RESULT_TYPE_VISIT:
case Ci.nsINavHistoryResultNode.RESULT_TYPE_FULL_VISIT:
nodeData["link"] = true;
uri = PlacesUtils._uri(node.uri);
if (PlacesUtils.nodeIsBookmark(node))
nodeData["bookmark"] = true;
break;
@ -673,9 +674,17 @@ PlacesController.prototype = {
// annotations
if (uri) {
var names = PlacesUtils.annotations.getPageAnnotationNames(uri, { });
var names = PlacesUtils.annotations.getPageAnnotationNames(uri, {});
for (var j = 0; j < names.length; ++j)
nodeData[names[i]] = true;
// For bookmark-items also include the bookmark-specific annotations
if ("bookmark" in nodeData) {
var placeURI = PlacesUtils.bookmarks.getItemURI(node.bookmarkId);
names = PlacesUtils.annotations.getPageAnnotationNames(placeURI, {});
for (j = 0; j < names.length; ++j)
nodeData[names[i]] = true;
}
}
#ifdef EXTENDED_LIVEBOOKMARKS_UI
else if (nodeType == Ci.nsINavHistoryResultNode.RESULT_TYPE_QUERY) {

View File

@ -195,8 +195,8 @@ LivemarkService.prototype = {
for (var i=0; i < cc; ++i) {
try {
var node = root.getChild(i);
this._ans.removeAnnotation(gIoService.newURI(node.uri, null, null),
LMANNO_BMANNO);
var placeURI = this._bms.getItemURI(node.bookmarkId);
this._ans.removeAnnotation(placeURI, LMANNO_BMANNO);
}
catch (ex) {
// continue
@ -561,7 +561,8 @@ LivemarkLoadListener.prototype = {
function LS_insertLivemarkChild(folderId, uri, title) {
var id = this._bms.insertItem(folderId, uri, this._bms.DEFAULT_INDEX);
this._bms.setItemTitle(id, title);
this._ans.setAnnotationString(uri, LMANNO_BMANNO, uri.spec, 0,
var placeURI = this._bms.getItemURI(id);
this._ans.setAnnotationString(placeURI, LMANNO_BMANNO, uri.spec, 0,
this._ans.EXPIRE_NEVER);
},