Bug 627408 - Port |Bug 620198 - Right pane tree of Library is not updated when i delete a selected folder in left pane tree| to SeaMonkey. r=Neil
authorJens Hatlak <jh@junetz.de>
Thu, 20 Jan 2011 23:53:07 +0100
changeset 6989 d0d624b467b63418cbe9f313f0062f8fc35f2ec2
parent 6988 1025dd5f0c49b51d0ea04cf311b9f97a40ef7dcf
child 6990 df7550b1d71ac40be42f56823b2e93669560aaf1
push idunknown
push userunknown
push dateunknown
reviewersNeil
bugs627408, 620198
Bug 627408 - Port |Bug 620198 - Right pane tree of Library is not updated when i delete a selected folder in left pane tree| to SeaMonkey. r=Neil
suite/common/history/treeView.js
suite/common/places/treeView.js
--- a/suite/common/history/treeView.js
+++ b/suite/common/history/treeView.js
@@ -1049,16 +1049,21 @@ PlacesTreeView.prototype = {
         return this._convertPRTimeToString(node.time);
       case "VisitCount":
         return node.accessCount || "";
     }
     return "";
   },
 
   setTree: function PTV_setTree(aTree) {
+    // If we are replacing the tree during a batch, there is a concrete risk
+    // that the treeView goes out of sync, thus it's safer to end the batch now.
+    // This is a no-op if we are not batching.
+    this.batching(false);
+
     var hasOldTree = this._tree != null;
     this._tree = aTree;
 
     if (this._result) {
       if (hasOldTree) {
         // detach from result when we are detaching from the tree.
         // This breaks the reference cycle between us and the result.
         if (!aTree)
--- a/suite/common/places/treeView.js
+++ b/suite/common/places/treeView.js
@@ -1388,16 +1388,21 @@ PlacesTreeView.prototype = {
         if (node.lastModified)
           return this._convertPRTimeToString(node.lastModified);
         return "";
     }
     return "";
   },
 
   setTree: function PTV_setTree(aTree) {
+    // If we are replacing the tree during a batch, there is a concrete risk
+    // that the treeView goes out of sync, thus it's safer to end the batch now.
+    // This is a no-op if we are not batching.
+    this.batching(false);
+
     let hasOldTree = this._tree != null;
     this._tree = aTree;
 
     if (this._result) {
       if (hasOldTree) {
         // detach from result when we are detaching from the tree.
         // This breaks the reference cycle between us and the result.
         if (!aTree) {