rem: gPrefBranch.setIntPref("mailnews.view.last", parseInt(val)); 
add:  var msgDatabase = GetFirstSelectedMsgFolder().getMsgDatabase(msgWindow); var dbFolderInfo = msgDatabase.dBFolderInfo; dbFolderInfo.setUint32Property("current-view", parseInt(val)); 
context: function viewChange(aMenuList, val){  if (val == kCustomItemValue) {     // restore to the previous view value, in case they cancel    aMenuList.value = gCurrentViewValue;    LaunchCustomizeDialog();    return;  }  // bail out early if the user picked the same view  if (val == gCurrentViewValue)    return;   viewDebug("viewChange to " + val + "\n");  var oldViewValue = gCurrentViewValue;  gCurrentViewValue = val;  switch (val)  {   case -1:   case "-1":   case "0": // View All     gDefaultSearchViewTerms = null;     break;   case "1": // Unread     ViewNewMail();     break;   case "2": // label 1   case "3": // label 2   case "4": // label 3   case "5": // label 4   case "6": // label 5     ViewLabel(parseInt(val) - kLabelOffset);     break;   case "7": // save view as virtual folder     val = oldViewValue;     aMenuList.value = val;     openNewVirtualFolderDialogWithArgs(gCurrentViewLabel, gSaveDefaultSVTerms);     break;   default:     LoadCustomMailView(parseInt(val) - kLastDefaultViewIndex);     break;  } //        gSaveDefaultSVTerms = gDefaultSearchViewTerms;  // store this, to persist across sessions  if (val != "-1" && val != -1)  {    if (aMenuList.selectedItem)      gCurrentViewLabel = aMenuList.selectedItem.label;    gPrefBranch.setIntPref("mailnews.view.last", parseInt(val));    }  // if we're switching to -1 (virtual folder), don't do a search   if (val != "-1" && val != -1)  {    onEnterInSearchBar();    gQSViewIsDirty = true;  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/bb88f322e61c8cec8e3a848b3532b022e9c5c22f/msgViewPickerOverlay.js/buggy/mailnews/extensions/mailviews/resources/content/msgViewPickerOverlay.js