[Commits] mh.c 1.79.2.72 1.79.2.73

ticho at claws-mail.org ticho at claws-mail.org
Wed Jun 20 22:12:55 CEST 2012


Update of /home/claws-mail/claws/src
In directory srv:/tmp/cvs-serv2428/src

Modified Files:
      Tag: gtk2
	mh.c 
Log Message:
2012-06-20 [ticho]	3.8.0cvs55

	* src/mh.c
		Fix for bug #1090 - Standard-folders appear again
		after rescanning tree

Index: mh.c
===================================================================
RCS file: /home/claws-mail/claws/src/mh.c,v
retrieving revision 1.79.2.72
retrieving revision 1.79.2.73
diff -u -d -r1.79.2.72 -r1.79.2.73
--- mh.c	27 May 2012 17:30:52 -0000	1.79.2.72
+++ mh.c	20 Jun 2012 20:12:53 -0000	1.79.2.73
@@ -778,7 +778,7 @@
 
 static gint mh_create_tree(Folder *folder)
 {
-	gchar *rootpath;
+	gchar *rootpath, *f;
 
 	cm_return_val_if_fail(folder != NULL, -1);
 
@@ -786,11 +786,42 @@
 	rootpath = LOCAL_FOLDER(folder)->rootpath;
 	MAKE_DIR_IF_NOT_EXIST(rootpath);
 	CHDIR_RETURN_VAL_IF_FAIL(rootpath, -1);
-	MAKE_DIR_IF_NOT_EXIST(INBOX_DIR);
-	MAKE_DIR_IF_NOT_EXIST(OUTBOX_DIR);
-	MAKE_DIR_IF_NOT_EXIST(QUEUE_DIR);
-	MAKE_DIR_IF_NOT_EXIST(DRAFT_DIR);
-	MAKE_DIR_IF_NOT_EXIST(TRASH_DIR);
+
+	/* Create special directories as needed */
+	if (folder->inbox != NULL &&
+			folder->inbox->path != NULL)
+		f = folder->inbox->path;
+	else
+		f = INBOX_DIR;
+	MAKE_DIR_IF_NOT_EXIST(f);
+
+	if (folder->outbox != NULL &&
+			folder->outbox->path != NULL)
+		f = folder->outbox->path;
+	else
+		f = OUTBOX_DIR;
+	MAKE_DIR_IF_NOT_EXIST(f);
+
+	if (folder->draft != NULL &&
+			folder->draft->path != NULL)
+		f = folder->draft->path;
+	else
+		f = DRAFT_DIR;
+	MAKE_DIR_IF_NOT_EXIST(f);
+
+	if (folder->queue != NULL &&
+			folder->queue->path != NULL)
+		f = folder->queue->path;
+	else
+		f = QUEUE_DIR;
+	MAKE_DIR_IF_NOT_EXIST(f);
+
+	if (folder->trash != NULL &&
+			folder->trash->path != NULL)
+		f = folder->trash->path;
+	else
+		f = TRASH_DIR;
+	MAKE_DIR_IF_NOT_EXIST(f);
 
 	return 0;
 }



More information about the Commits mailing list