[Pkg-mozext-commits] [nostalgy] 23/252: *** empty log message ***
David Prévot
taffit at moszumanska.debian.org
Tue Jun 14 15:24:38 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository nostalgy.
commit 4f471de80066af23fa8bfbf047f40c190c5601b7
Author: frisch <frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date: Thu Aug 31 12:23:51 2006 +0000
*** empty log message ***
---
content/nostalgy.js | 40 ++++++++++++++++++++++++++++++++++++++--
files | 11 +++++------
2 files changed, 43 insertions(+), 8 deletions(-)
diff --git a/content/nostalgy.js b/content/nostalgy.js
index f25c163..1f37652 100644
--- a/content/nostalgy.js
+++ b/content/nostalgy.js
@@ -201,8 +201,44 @@ function NostalgySuggest() {
/** Commands **/
-function ShowFolder(folder) {
- SelectFolder(folder.URI);
+// NOTE. Thunderbird's SelectFolder is buggy. Here is a situation
+// where it breaks. Assume we want to select folder A/B/C, and that:
+// (i) folder A is closed, (ii) folder B is open
+// TB would correctly open A but it would also incorrectly close B.
+// Here's the reason. SelectFolder calls EnsureFolderIndex to ensure that
+// folder C is visible, that is: all its ancestors are open.
+// The algorithm of TB's EnsureFolderIndex is:
+// (i) is the folder is visible, ok
+// (ii) otherwise, make the parent visible, and then *toggle* the state
+// of the parent
+// This is wrong because the parent could already be open and the folder
+// could still be invisible if another ancestor is closed. In this
+// case, one must make the parent visible, and then check again
+// if the folder has become visible before toggling the parent's state
+
+
+function NostalgyEnsureFolderIndex(builder, msgFolder)
+{
+ // try to get the index of the folder in the tree
+ var index = builder.getIndexOfResource(msgFolder);
+ if (index == -1) {
+ // if we couldn't find the folder, make all its ancestors visible
+ parent_idx = NostalgyEnsureFolderIndex(builder, msgFolder.parent);
+ // maybe the folder is now visible
+ index = builder.getIndexOfResource(msgFolder);
+ // no: this means that the parent is closed, so open it.
+ if (index == -1) {
+ builder.toggleOpenState(parent_idx);
+ index = builder.getIndexOfResource(msgFolder);
+ }
+ }
+ return index;
+}
+
+function ShowFolder(folder) {
+ var folderTree = GetFolderTree();
+ var idx = NostalgyEnsureFolderIndex(folderTree.builderView, folder);
+ ChangeSelection(folderTree, idx);
}
function MoveToFolder(folder) {
diff --git a/files b/files
index d899d58..081b440 100644
--- a/files
+++ b/files
@@ -1,13 +1,12 @@
-content/.#nostalgy.js.1.3
-content/thunderbirdOverlay.xul
-content/about.xhtml
content/about.xul
-content/edit_prefs.js
content/edit_prefs.xul
-content/edit_rule.js
+content/thunderbirdOverlay.xul
+content/messageOverlay.xul
+content/about.xhtml
content/edit_rule.xul
content/folders.js
-content/messageOverlay.xul
+content/edit_rule.js
+content/edit_prefs.js
content/nostalgy.js
locale/en-US/nostalgy.dtd
locale/en-US/nostalgy.properties
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nostalgy.git
More information about the Pkg-mozext-commits
mailing list