Re: [evolution-patches] 63881 (dragging messages from vfolders)



On Wed, 2004-08-25 at 11:43 +0800, Not Zed wrote:
> 
> The unmatched folder's parent store should not be the same as the imap
> folder's parent store in the first place, so i think this patch is
> just hiding another bug.

Yeah, true.

> I suspect it is something to do with the order of initialisation,
> perhaps the imap's trash folder is the first vfolder to come into
> existance, so the unmatched folder is getting the wrong parent store.

Yes, that's it. The unmatched folder is getting created in
camel_vee_folder_construct, which is called from camel_vtrash_folder_new
when the Trash and Junk folders are created for the imap store.

If I understand correctly, the Trash and Junk vtrash folders don't need
the unmatched folder to exist, so it should be OK to defer creating the
unmatched folder till an actual vfolder is created (test !
CAMEL_IS_VTRASH_FOLDER(vf) in camel_vee_folder_construct). The patch to
do this is attached.

Aha! Just tested it and it makes the unread count on Unmatched actually
work. (It broke for me sometime around 1.4, obviously this is why...).

> It would probably make sense for the unmatched folder to be
> initialised explictly somehow, rather than being intialised the first
> time a folder is initialised.  Although at an initial glance i'm not
> sure where this can be done since the evolution root vfolder store is
> setup outside of camel.
> 
> The unmatched folder should really be specific to the vee-store itself
> actually.
--- camel/camel-vee-folder.c	2004/08/26 21:44:03	1.1
+++ camel/camel-vee-folder.c	2004/08/26 22:10:55
@@ -29,6 +29,7 @@
 
 #include "camel-exception.h"
 #include "camel-vee-folder.h"
+#include "camel-vtrash-folder.h"
 #include "camel-store.h"
 #include "camel-folder-summary.h"
 #include "camel-mime-message.h"
@@ -234,7 +235,7 @@ camel_vee_folder_construct(CamelVeeFolde
 	UNMATCHED_LOCK();
 	
 	/* setup unmatched folder if we haven't yet */
-	if (folder_unmatched == NULL) {
+	if (!CAMEL_IS_VTRASH_FOLDER(vf) && folder_unmatched == NULL) {
 		unmatched_uids = g_hash_table_new (g_str_hash, g_str_equal);
 		folder_unmatched = (CamelVeeFolder *)camel_object_new (camel_vee_folder_get_type ());
 		d(printf("created foldeer unmatched %p\n", folder_unmatched));


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