From 1374cd6b4ba89c9fb3c9c236702cec9aafe2f45e Mon Sep 17 00:00:00 2001 From: "reed%reedloden.com" Date: Wed, 5 Dec 2007 20:16:10 +0000 Subject: [PATCH] Bug 405237 - "deleting "Unfiled Bookmarks" or "bookmarks menu" folders breaks places organizer (should be undeletable)" (Supplimental perf fix) [p=mak77@supereva.it (Marco Bonardo [MaK77]) r=Mano a=blocking1.9+ P1 for M10] --- browser/components/places/content/controller.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/browser/components/places/content/controller.js b/browser/components/places/content/controller.js index 798ccfeeeea..d1af29bdc0e 100755 --- a/browser/components/places/content/controller.js +++ b/browser/components/places/content/controller.js @@ -278,21 +278,18 @@ PlacesController.prototype = { var nodes = this._view.getSelectionNodes(); var root = this._view.getResultNode(); - var bmFolderId = PlacesUtils.bookmarksMenuFolderId; - var ubFolderId = PlacesUtils.unfiledBookmarksFolderId; - var btFolderId = PlacesUtils.toolbarFolderId; - for (var i = 0; i < nodes.length; ++i) { // Disallow removing the view's root node if (nodes[i] == root) return false; - // Disallow removing the toolbar folder + // Disallow removing the toolbar, menu and unfiled-bookmarks folders + var nodeItemId = nodes[i].itemId; if (!aIsMoveCommand && - PlacesUtils.nodeIsFolder(nodes[i]) && - (nodes[i].itemId == btFolderId || - nodes[i].itemId == ubFolderId || - nodes[i].itemId == bmFolderId)) + PlacesUtils.nodeIsFolder(nodes[i]) && + (nodeItemId == PlacesUtils.toolbarFolderId || + nodeItemId == PlacesUtils.unfiledBookmarksFolderId || + nodeItemId == PlacesUtils.bookmarksMenuFolderId)) return false; // We don't call nodeIsReadOnly here, because nodeIsReadOnly means that