bug 474701, back out virtual folder changes that affect the UI. bustage fix.

This commit is contained in:
Andrew Sutherland 2009-05-06 02:52:35 -07:00
Родитель d5113ef829
Коммит fdea8809fd
2 изменённых файлов: 35 добавлений и 5 удалений

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

@ -37,8 +37,6 @@
*
* ***** END LICENSE BLOCK ***** */
Component.utils.import("resource://app/modules/virtualFolderWrapper.js");
var gPickedFolder;
var gMailView = null;
var msgWindow; // important, don't change the name of this variable. it's really a global used by commandglue.js
@ -232,9 +230,7 @@ function onOK()
}
saveSearchTerms(gSearchTermSession.searchTerms, gSearchTermSession);
VirtualFolderHelper.createVirtualFolder(
name, parentFolder, gSearchFolderURIs, gSearchTermSession.searchTerms,
searchOnline);
CreateVirtualFolder(name, parentFolder, gSearchFolderURIs, gSearchTermSession.searchTerms, searchOnline);
}
return true;

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

@ -1012,6 +1012,40 @@ function getSearchTermString(searchTerms)
return condition;
}
function CreateVirtualFolder(newName, parentFolder, searchFolderURIs, searchTerms, searchOnline)
{
// ### need to make sure view/folder doesn't exist.
if (searchFolderURIs && (searchFolderURIs != "") && newName && (newName != ""))
{
try
{
var newFolder = parentFolder.addSubfolder(newName);
newFolder.setFlag(Components.interfaces.nsMsgFolderFlags.Virtual);
var vfdb = newFolder.msgDatabase;
var searchTermString = getSearchTermString(searchTerms);
var dbFolderInfo = vfdb.dBFolderInfo;
// set the view string as a property of the db folder info
// set the original folder name as well.
dbFolderInfo.setCharProperty("searchStr", searchTermString);
dbFolderInfo.setCharProperty("searchFolderUri", searchFolderURIs);
dbFolderInfo.setBooleanProperty("searchOnline", searchOnline);
vfdb.summaryValid = true;
vfdb.Close(true);
parentFolder.NotifyItemAdded(newFolder);
var accountManager = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
accountManager.saveVirtualFolders();
}
catch(e)
{
throw(e); // so that the dialog does not automatically close
dump ("Exception : creating virtual folder \n");
}
}
else
{
dump("no name or nothing selected\n");
}
}
var searchSessionContractID = "@mozilla.org/messenger/searchSession;1";
var gSearchView;