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]

This commit is contained in:
reed%reedloden.com 2007-12-05 20:16:10 +00:00
Родитель a287d7d585
Коммит 1374cd6b4b
1 изменённых файлов: 6 добавлений и 9 удалений

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

@ -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