rem:  var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView); if (treeView) { var tree = GetThreadTree(); tree.boxObject.QueryInterface(Components.interfaces.nsITreeBoxObject).view = treeView; } 
add: RerootThreadPane(); 
context: function SwitchView(command){  // when switching thread views, we might be coming out of quick search  // or a message view.  // first set view picker to all  ViewMessagesBy("viewPickerAll");  // clear the QS text, if we need to  ClearQSIfNecessary();    // now switch views  var oldSortType = gDBView ? gDBView.sortType : nsMsgViewSortType.byThread;  var oldSortOrder = gDBView ? gDBView.sortOrder : nsMsgViewSortOrder.ascending;  var viewFlags = gDBView ? gDBView.viewFlags : gCurViewFlags;  // close existing view.  if (gDBView) {    gDBView.close();    gDBView = null;   }  switch(command)  {    case "cmd_viewUnreadMsgs":      viewFlags = viewFlags | nsMsgViewFlagsType.kUnreadOnly;      CreateDBView(msgWindow.openFolder, nsMsgViewType.eShowAllThreads, viewFlags,            oldSortType, oldSortOrder );    break;    case "cmd_viewAllMsgs":      viewFlags = viewFlags & ~nsMsgViewFlagsType.kUnreadOnly;      CreateDBView(msgWindow.openFolder, nsMsgViewType.eShowAllThreads, viewFlags,            oldSortType, oldSortOrder);    break;    case "cmd_viewThreadsWithUnread":      CreateDBView(msgWindow.openFolder, nsMsgViewType.eShowThreadsWithUnread, nsMsgViewFlagsType.kThreadedDisplay,            nsMsgViewSortType.byThread, oldSortOrder);    break;    case "cmd_viewWatchedThreadsWithUnread":      CreateDBView(msgWindow.openFolder, nsMsgViewType.eShowWatchedThreadsWithUnread, nsMsgViewFlagsType.kThreadedDisplay,            nsMsgViewSortType.byThread, oldSortOrder);   break;    case "cmd_viewIgnoredThreads":      if (viewFlags & nsMsgViewFlagsType.kShowIgnored)        viewFlags = viewFlags & ~nsMsgViewFlagsType.kShowIgnored;      else        viewFlags = viewFlags | nsMsgViewFlagsType.kShowIgnored;      CreateDBView(msgWindow.openFolder, nsMsgViewType.eShowAllThreads, viewFlags,            oldSortType, oldSortOrder);    break;  }  // that should have initialized gDBView, now re-root the thread pane  var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView);  if (treeView)  {    var tree = GetThreadTree();    tree.boxObject.QueryInterface(Components.interfaces.nsITreeBoxObject).view = treeView;  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/1fcd61bad4de025f0a8ae9aeb1b600679655e9b4/commandglue.js/clean/mail/base/content/commandglue.js