And some other fixes to tny-camel-folder.c



Hi,

some other minor improvements to the camel folder. This time the patch
adds some useful initializations, and two typos. The first one is a
repeated instruction and the in second one, where I have some doubts, I
replaced:

if (!cant_reuse_iter)
    cant_reuse_iter = cant_reuse_iter;

by

if (!cant_reuse_iter)
    cant_reuse_iter = priv->cant_reuse_iter;

See in the attached patch.

Br
Index: libtinymail-camel/tny-camel-folder.c
===================================================================
--- libtinymail-camel/tny-camel-folder.c	(revision 3804)
+++ libtinymail-camel/tny-camel-folder.c	(working copy)
@@ -572,7 +572,6 @@
 				/* g_critical ("Can't load folder: %s", camel_exception_get_description (&priv->load_ex)); */
 
 				priv->folder = NULL;
-				priv->folder = NULL;
 				priv->loaded = FALSE;
 
 				return FALSE;
@@ -1265,7 +1264,7 @@
 {
 	RemMsgsInfo *info;
 	TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self);
-	
+
 	/* Idle info for the callbacks */
 	info = g_slice_new (RemMsgsInfo);
 	info->session = TNY_FOLDER_PRIV_GET_SESSION (priv);
@@ -1276,6 +1275,7 @@
 	info->callback = callback;
 	info->user_data = user_data;
 	info->err = NULL;
+	info->cancelled = FALSE;
 
 	/* thread reference */
 	g_object_ref (info->self);
@@ -1802,7 +1802,7 @@
 	info->user_data = user_data;
 	info->expunge = expunge;
 	info->err = NULL;
-
+	info->cancelled = FALSE;
 	info->stopper = tny_idle_stopper_new();
 
 	/* thread reference */
@@ -2047,7 +2047,7 @@
 	info->status_callback = status_callback;
 	info->user_data = user_data;
 	info->err = NULL;
-
+	info->cancelled = FALSE;
 	info->stopper = tny_idle_stopper_new();
 
 	/* thread reference */
@@ -2339,6 +2339,7 @@
 	info->status_callback = status_callback;
 	info->user_data = user_data;
 	info->err = NULL;
+	info->cancelled = FALSE;
 	info->stopper = tny_idle_stopper_new();
 
 	/* thread reference */
@@ -3578,18 +3579,14 @@
 
 		tny_debug ("tny_folder_copy: recurse_copy\n");
 
-		if (nerr != NULL)
-			g_error_free (nerr);
-		nerr = NULL;
-
 		/* The recurse_copy call deletes the original folder if del==TRUE */
 		cpyr = recurse_copy (self, into, new_name, del, &nerr, adds, rems);
 
 		if (nerr != NULL) {
 			if (!tried)
 				g_propagate_error (err, nerr);
-			/* else
-				g_error_free (nerr); */
+			else
+				g_error_free (nerr);
 		} else {
 			/* Unload the folder. This way we'll get the
 			   right CamelFolderInfo objects for the
@@ -5243,6 +5240,7 @@
 	info->user_data = user_data;
 	info->new_folder = NULL;
 	info->err = NULL;
+	info->cancelled = FALSE;
 
 	/* thread reference */
 	_tny_camel_folder_reason (priv);
@@ -5365,7 +5363,7 @@
 	}
 
 	if (!cant_reuse_iter)
-		cant_reuse_iter = cant_reuse_iter;
+		cant_reuse_iter = priv->cant_reuse_iter;
 
 	if ((!priv->iter && priv->iter_parented) || cant_reuse_iter)
 	{
@@ -5572,6 +5570,7 @@
 	info->query = query;
 	info->refresh = refresh;
 	info->err = NULL;
+	info->cancelled = FALSE;
 
 	/* thread reference */
 	_tny_camel_folder_reason (priv);
@@ -5770,6 +5769,7 @@
 	info->callback = callback;
 	info->user_data = user_data;
 	info->err = NULL;
+	info->cancelled = FALSE;
 
 	/* thread reference */
 	_tny_camel_folder_reason (priv);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 3804)
+++ ChangeLog	(working copy)
@@ -1,19 +1,25 @@
 2008-11-18  Sergio Villar Senin  <svillar igalia com>
 
-	* libtinymail-camel/tny-camel-mime-part-priv.h: Moved a function
-	header into the #ifdef
-
 	* libtinymail-camel/tny-camel-folder.c: several bugfixes. Fixed an
 	invalid comparison (a typo most likely). Fixed several memory
 	leaks as well in some lists that were not freed.
+	(load_folder_no_lock): removed a duplicated instruction.
+	Added several initializations of cancelled field all around the
+	code.
+	(tny_camel_folder_copy_shared): removed needless code and fixed a
+	memory leak.
+	(tny_camel_folder_get_folders_default): fixed an useless asignment
 
+	* libtinymail-camel/tny-camel-mime-part-priv.h: Moved a function
+	header into the #ifdef
+
 2008-11-13  Thomas Guillem  <thomas guillem gmail com>
 
 	* libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.c:
 	Change the default cache filename from "uid." to "uid.~" in order to
 	keep compatibility with FAT32 partitions. (a FAT32 file can't end with '.')
 	Old cache files ("uid.") are still compatible.
-	
+
 2008-11-10  Jose Dapena Paz  <jdapena igalia com>
 
 	Complete rework of the lock behavior of Tinymail


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