diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2004-03-24 04:09:55 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-03-24 04:09:55 +0800 |
commit | 04693dc8f8807a51a55e8f54f2b306c626b958ea (patch) | |
tree | a9f8f6266561afbce402496b33f07b00ed05ebe6 /mail/em-folder-tree-model.c | |
parent | 518b4301681a35c80348f61ce270bada8e2a07c8 (diff) | |
download | gsoc2013-evolution-04693dc8f8807a51a55e8f54f2b306c626b958ea.tar.gz gsoc2013-evolution-04693dc8f8807a51a55e8f54f2b306c626b958ea.tar.zst gsoc2013-evolution-04693dc8f8807a51a55e8f54f2b306c626b958ea.zip |
Fixed some logic bugs.
2004-03-23 Jeffrey Stedfast <fejj@ximian.com>
* em-folder-tree-model.c (em_folder_tree_model_set_expanded):
Fixed some logic bugs.
svn path=/trunk/; revision=25164
Diffstat (limited to 'mail/em-folder-tree-model.c')
-rw-r--r-- | mail/em-folder-tree-model.c | 17 |
1 files changed, 7 insertions, 10 deletions
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); } |