Optimize PerformExpandForAllOpenServers
This commit is contained in:
scott%scott-macgregor.org 2004-05-31 06:31:29 +00:00
Родитель f8fc2ba2c6
Коммит 5a7cfe234f
1 изменённых файлов: 8 добавлений и 19 удалений

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

@ -34,6 +34,9 @@ const kStandardPaneConfig = 0;
const kWidePaneConfig = 1;
const kVerticalPaneConfig = 2;
// from nsMsgFolderFlags.h
const MSG_FOLDER_FLAG_ELIDED = 0x10;
var gFolderTree;
var gMessagePane;
var gThreadTree;
@ -794,26 +797,12 @@ function NotifyObservers(aSubject, aTopic, aData)
// PerformExpand() for all servers that are open at startup.
function PerformExpandForAllOpenServers()
{
var folderTree = GetFolderTree();
var view = folderTree.treeBoxObject.view;
for (var i = 0; i < view.rowCount; i++)
var servers = accountManager.allServers;
for (var i = 0; i < servers.Count(); i++)
{
if (view.isContainer(i))
{
var folderResource = GetFolderResource(folderTree, i);
var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder);
var isServer = GetFolderAttribute(folderTree, folderResource, "IsServer");
if (isServer == "true")
{
if (view.isContainerOpen(i))
{
var server = msgFolder.server;
// Don't do this for imap servers. See bug #41943
if (server.type != "imap")
server.performExpand(msgWindow);
}
}
}
var server = servers.QueryElementAt(i, Components.interfaces.nsIMsgIncomingServer);
if (server.type != "imap" && !server.rootMsgFolder.getFlag(MSG_FOLDER_FLAG_ELIDED))
server.performExpand(msgWindow);
}
}