add: if (sortType == nsMsgViewSortType.byThread || sortType == nsMsgViewSortType.byId || sortType == nsMsgViewSortType.byNone) viewFlags &= ~nsMsgViewFlagsType.kGroupBySort;  
context: function CreateBareDBView(originalView, msgFolder, viewType, viewFlags, sortType, sortOrder){  var dbviewContractId = "@mozilla.org/messenger/msgdbview;1?type=";  // hack to turn this into an integer, if it was a string  // it would be a string if it came from localStore.rdf  viewType = viewType - 0;  switch (viewType) {      case nsMsgViewType.eShowQuickSearchResults:          dbviewContractId += "quicksearch";          break;      case nsMsgViewType.eShowThreadsWithUnread:          dbviewContractId += "threadswithunread";          break;      case nsMsgViewType.eShowWatchedThreadsWithUnread:          dbviewContractId += "watchedthreadswithunread";          break;      case nsMsgViewType.eShowVirtualFolderResults:          dbviewContractId += "xfvf";          break;      case nsMsgViewType.eShowAllThreads:      default:          if (viewFlags & nsMsgViewFlagsType.kGroupBySort)            dbviewContractId += "group";          else            dbviewContractId += "threaded";          break;  }//  dump ("contract id = " + dbviewContractId + "original view = " + originalView + "\n");  if (!originalView)    gDBView = Components.classes[dbviewContractId].createInstance(Components.interfaces.nsIMsgDBView);  gCurViewFlags = viewFlags;  var count = new Object;  if (!gThreadPaneCommandUpdater)    gThreadPaneCommandUpdater = new nsMsgDBViewCommandUpdater();  gCurSortType = sortType;  if (!originalView) {    gDBView.init(messenger, msgWindow, gThreadPaneCommandUpdater);    gDBView.open(msgFolder, gCurSortType, sortOrder, viewFlags, count);    if (viewType == nsMsgViewType.eShowVirtualFolderResults)    {      // the view is a listener on the search results      gViewSearchListener = gDBView.QueryInterface(Components.interfaces.nsIMsgSearchNotify);      gSearchSession.registerListener(gViewSearchListener);    }  }   else {    gDBView = originalView.cloneDBView(messenger, msgWindow, gThreadPaneCommandUpdater);  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/3184e01b75606c058b8438ef584866300dfe971e/commandglue.js/buggy/mail/base/content/commandglue.js