Re: Descending IMAP trees



On 2001.06.14 07:57 Pawel Salek wrote:
> 
> Thanks for the patch, I have just commited it without any change. There
> was one potential issue related to setting BalsaMailboxNode::name field.

Setting it doesn't seem to be necessary--it was left over from earlier
attempts to get into my IMAP tree. I've reverted to something much closer
to version 1.1.5.  In src/mailbox-node.c, add_imap_entry() goes back to the
old version, and the only remaining change is in imap_dir_cb(), which
traverses all nodes.  The attached patch is against current CVS.

> I would rather see some accessor method defined instead of copying
> strings on left and right :-). 

Not sure of the distinction between a left copy and a right copy :)

> (I am finally back after my PhD dissertation, what a relieve...).

Congratulations!

> 
> /pawel

Peter
diff -Naur --exclude=.* balsa/src/mailbox-node.c balsa-temp/src/mailbox-node.c
--- balsa/src/mailbox-node.c	Mon Jun 18 09:23:44 2001
+++ balsa-temp/src/mailbox-node.c	Mon Jun 18 09:37:42 2001
@@ -750,7 +750,6 @@
     GNode* parent;
     BalsaMailboxNode* mbnode;
     gchar * parent_name = get_parent_folder_name(fn, delim);
-    const gchar *basename = strrchr(fn, delim);
 
     parent = get_parent_by_name(root, parent_name);
     g_free(parent_name);
@@ -760,14 +759,12 @@
 	mbnode = 
 	    balsa_mailbox_node_new_from_mailbox(LIBBALSA_MAILBOX(mailbox));
     else {
+	const gchar *basename = strrchr(fn, delim);
+	if(!basename) basename = fn;
+	else basename++;
 	mbnode = balsa_mailbox_node_new();
+	mbnode->name = g_strdup(basename);
     }
-    /* mbnode->name used to be set only for folders, 
-       but it seems to be OK to do it also for mailboxes. */
-    if(!basename) basename = fn;
-    else basename++;
-    mbnode->name = g_strdup(basename);
-
     mbnode->dir = g_strdup(fn);
     return g_node_append(parent, g_node_new(mbnode));
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]