From 7059ac12f2f4c577307ad140dd995414d5f14adc Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Mon, 31 May 2004 06:31:29 +0000 Subject: [PATCH] Port Neil's fix for Bug #165610 Optimize PerformExpandForAllOpenServers --- mail/base/content/msgMail3PaneWindow.js | 27 ++++++++----------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/mail/base/content/msgMail3PaneWindow.js b/mail/base/content/msgMail3PaneWindow.js index fb3f90a1cd8e..c4b0fdb0d858 100644 --- a/mail/base/content/msgMail3PaneWindow.js +++ b/mail/base/content/msgMail3PaneWindow.js @@ -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); } }