diff --git a/browser/components/places/content/controller.js b/browser/components/places/content/controller.js index f2fa301dfbe6..5ab0bd7967ba 100755 --- a/browser/components/places/content/controller.js +++ b/browser/components/places/content/controller.js @@ -139,7 +139,7 @@ PlacesController.prototype = { return false; if (this._view.hasSingleSelection && PlacesUtils.nodeIsFolder(node)) { - var contents = PlacesUtils.getFolderContents(node.itemId, false, false); + var contents = PlacesUtils.getFolderContents(node.itemId, false, false).root; for (var i = 0; i < contents.childCount; ++i) { var child = contents.getChild(i); if (PlacesUtils.nodeIsURI(child)) @@ -894,7 +894,7 @@ PlacesController.prototype = { // Open each uri in the folder in a tab. var index = firstIndex; var urlsToOpen = []; - var contents = PlacesUtils.getFolderContents(node.itemId, false, false); + var contents = PlacesUtils.getFolderContents(node.itemId, false, false).root; for (var i = 0; i < contents.childCount; ++i) { var child = contents.getChild(i); if (PlacesUtils.nodeIsURI(child)) @@ -1874,7 +1874,7 @@ PlacesRemoveFolderTransaction.prototype = { */ _saveFolderContents: function PRFT__saveFolderContents() { this._transactions = []; - var contents = this.utils.getFolderContents(this._id, false, false); + var contents = this.utils.getFolderContents(this._id, false, false).root; var ios = Cc["@mozilla.org/network/io-service;1"]. getService(Ci.nsIIOService); for (var i = 0; i < contents.childCount; ++i) { @@ -2235,7 +2235,7 @@ PlacesSortFolderByNameTransaction.prototype = { doTransaction: function PSSFBN_doTransaction() { this._oldOrder = []; - var contents = this.utils.getFolderContents(this._folderId, false, false); + var contents = this.utils.getFolderContents(this._folderId, false, false).root; var count = contents.childCount; // sort between separators diff --git a/browser/components/places/content/places.js b/browser/components/places/content/places.js index 5436c4b3767e..ecc19d8232a7 100755 --- a/browser/components/places/content/places.js +++ b/browser/components/places/content/places.js @@ -318,8 +318,8 @@ var PlacesOrganizer = { var selectedNode = aView.selectedNode; if (selectedNode) { if (PlacesUtils.nodeIsFolder(selectedNode)) { - var childsCount = - PlacesUtils.getFolderContents(selectedNode.itemId).childCount; + var childsCount = + PlacesUtils.getFolderContents(selectedNode.itemId).root.childCount; statusText = PlacesUtils.getFormattedString("status_foldercount", [childsCount]); } diff --git a/browser/components/places/content/utils.js b/browser/components/places/content/utils.js index 11d4722f712f..da3d21ae3bd1 100644 --- a/browser/components/places/content/utils.js +++ b/browser/components/places/content/utils.js @@ -709,7 +709,7 @@ var PlacesUtils = { }, /** - * Generates a HistoryResultNode for the contents of a folder. + * Generates a nsINavHistoryResult for the contents of a folder. * @param folderId * The folder to open * @param [optional] excludeItems @@ -719,8 +719,8 @@ var PlacesUtils = { * True to make query items expand as new containers. For managing, * you want this to be false, for menus and such, you want this to * be true. - * @returns A HistoryContainerResultNode containing the contents of the - * folder. This container is guaranteed to be open. + * @returns A nsINavHistoryResult containing the contents of the + * folder. The result.root is guaranteed to be open. */ getFolderContents: function PU_getFolderContents(aFolderId, aExcludeItems, aExpandQueries) { @@ -733,7 +733,8 @@ var PlacesUtils = { var result = this.history.executeQuery(query, options); result.root.containerOpen = true; - return asContainer(result.root); + asContainer(result.root); + return result; }, /** diff --git a/browser/components/preferences/selectBookmark.js b/browser/components/preferences/selectBookmark.js index c1a11b83269d..2cbed3196fff 100644 --- a/browser/components/preferences/selectBookmark.js +++ b/browser/components/preferences/selectBookmark.js @@ -91,7 +91,7 @@ var SelectBookmarkDialog = { var names = []; var selectedNode = bookmarks.selectedNode; if (PlacesUtils.nodeIsFolder(selectedNode)) { - var contents = PlacesUtils.getFolderContents(selectedNode.itemId); + var contents = PlacesUtils.getFolderContents(selectedNode.itemId).root; var cc = contents.childCount; for (var i = 0; i < cc; ++i) { var node = contents.getChild(i);