Bug 457677 - PlacesUtils ignores dynamic containers, r=dietrich

This commit is contained in:
Marco Bonardo 2008-10-13 17:54:25 +02:00
parent 12436dcf0c
commit b1351fc910

View File

@ -217,10 +217,9 @@ var PlacesUtils = {
* @returns true if the node is a visit item, false otherwise
*/
nodeIsVisit: function PU_nodeIsVisit(aNode) {
const NHRN = Ci.nsINavHistoryResultNode;
var type = aNode.type;
return type == NHRN.RESULT_TYPE_VISIT ||
type == NHRN.RESULT_TYPE_FULL_VISIT;
return type == Ci.nsINavHistoryResultNode.RESULT_TYPE_VISIT ||
type == Ci.nsINavHistoryResultNode.RESULT_TYPE_FULL_VISIT;
},
/**
@ -254,8 +253,8 @@ var PlacesUtils = {
* @returns true if the node is readonly, false otherwise
*/
nodeIsReadOnly: function PU_nodeIsReadOnly(aNode) {
if (this.nodeIsFolder(aNode))
return this.bookmarks.getFolderReadonly(asQuery(aNode).folderItemId);
if (this.nodeIsFolder(aNode) || this.nodeIsDynamicContainer(aNode))
return this.bookmarks.getFolderReadonly(this.getConcreteItemId(aNode));
if (this.nodeIsQuery(aNode) &&
asQuery(aNode).queryOptions.resultType !=
Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_CONTENTS)
@ -344,7 +343,7 @@ var PlacesUtils = {
* @returns true if the node is a dynamic container item, false otherwise
*/
nodeIsDynamicContainer: function PU_nodeIsDynamicContainer(aNode) {
if (aNode.type == NHRN.RESULT_TYPE_DYNAMIC_CONTAINER)
if (aNode.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_DYNAMIC_CONTAINER)
return true;
return false;
},