aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-store.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2003-10-22 02:51:30 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2003-10-22 02:51:30 +0800
commit21743ac2cfa2d2ddcd539e9b7695cc8dd720ef36 (patch)
tree0111dbe4d8a6d5617f5e5406001b0024e4293169 /camel/camel-store.c
parent653cfffc0e00dfb59b36813c1b45c53d3f773c65 (diff)
downloadgsoc2013-evolution-21743ac2cfa2d2ddcd539e9b7695cc8dd720ef36.tar.gz
gsoc2013-evolution-21743ac2cfa2d2ddcd539e9b7695cc8dd720ef36.tar.zst
gsoc2013-evolution-21743ac2cfa2d2ddcd539e9b7695cc8dd720ef36.zip
Merge new-ui-branch into the trunk.
svn path=/trunk/; revision=22966
Diffstat (limited to 'camel/camel-store.c')
-rw-r--r--camel/camel-store.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/camel/camel-store.c b/camel/camel-store.c
index eedc9dfa2a..3c49f312ec 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -776,7 +776,7 @@ CamelFolderInfo *
camel_folder_info_build (GPtrArray *folders, const char *namespace,
char separator, gboolean short_names)
{
- CamelFolderInfo *fi, *pfi, *top = NULL;
+ CamelFolderInfo *fi, *pfi, *top = NULL, *tail = NULL;
GHashTable *hash;
char *name, *p, *pname;
int i, nlen;
@@ -854,9 +854,15 @@ camel_folder_info_build (GPtrArray *folders, const char *namespace,
g_hash_table_insert (hash, pname, pfi);
g_ptr_array_add (folders, pfi);
}
- fi->sibling = pfi->child;
+ tail = pfi->child;
+ if (tail == NULL) {
+ pfi->child = fi;
+ } else {
+ while (tail->sibling)
+ tail = tail->sibling;
+ tail->sibling = fi;
+ }
fi->parent = pfi;
- pfi->child = fi;
} else if (!top)
top = fi;
}
@@ -864,13 +870,18 @@ camel_folder_info_build (GPtrArray *folders, const char *namespace,
g_hash_table_destroy (hash);
/* Link together the top-level folders */
+ tail = top;
for (i = 0; i < folders->len; i++) {
fi = folders->pdata[i];
if (fi->parent || fi == top)
continue;
- if (top)
- fi->sibling = top;
- top = fi;
+ if (tail == NULL) {
+ tail = fi;
+ top = fi;
+ } else {
+ tail->sibling = fi;
+ tail = fi;
+ }
}
return top;