aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/em-folder-tree-model.c17
2 files changed, 12 insertions, 10 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index e8032ec751..e1afd0d0e7 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-23 Jeffrey Stedfast <fejj@ximian.com>
+
+ * em-folder-tree-model.c (em_folder_tree_model_set_expanded):
+ Fixed some logic bugs.
+
2004-03-23 Radek Doulik <rodo@ximian.com>
* em-format-html-display.c (efhd_format_attachment): use
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 4efa1ca7f9..0c1c689ecf 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -998,21 +998,18 @@ em_folder_tree_model_set_expanded (EMFolderTreeModel *model, const char *key, gb
*p = '\0';
if (!(node = find_xml_node (node, name))) {
- if (expanded) {
- /* node (or parent node) doesn't exist, need to add it */
- node = xmlNewChild (parent, NULL, "node", NULL);
- xmlSetProp (node, "name", name);
- xmlSetProp (node, "expand", "true");
- } else {
+ if (!expanded) {
/* node doesn't exist, so we don't need to set expanded to FALSE */
return;
}
- } else if (p == NULL && !expanded) {
- /* found the node we were looking for */
- xmlSetProp (node, "expand", "false");
- return;
+
+ /* node (or parent node) doesn't exist, need to add it */
+ node = xmlNewChild (parent, NULL, "node", NULL);
+ xmlSetProp (node, "name", name);
}
+ xmlSetProp (node, "expand", expanded || p ? "true" : "false");
+
name = p ? p + 1 : NULL;
} while (name);
}