Patch: add unmute before camel_operation_end()



Hello,

   As Philip pointed out on the irc, it's better for comprehension to
unmute the camel_operation before ending it. Attached is the patch.


-- 
Martin
Index: libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
===================================================================
--- libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c	(révision 3820)
+++ libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c	(copie de travail)
@@ -3314,6 +3314,7 @@
 				imap_folder->cancel_occurred = TRUE;
 			else
 				g_warning ("IMAP error getting UIDs (1)");
+			camel_operation_unmute (NULL);
 			camel_operation_end (NULL);
 			return;
 		}
@@ -3331,6 +3332,7 @@
 
 		g_ptr_array_foreach (needheaders, (GFunc)g_free, NULL);
 		g_ptr_array_free (needheaders, TRUE);
+		camel_operation_unmute (NULL);
 		camel_operation_end (NULL);
 		more = FALSE;
 		camel_folder_summary_kill_hash (folder->summary);
@@ -3359,6 +3361,7 @@
 			else
 				g_warning ("IMAP error getting UIDs (1,1,1)");
 			camel_folder_summary_kill_hash (folder->summary);
+			camel_operation_unmute (NULL);
 			camel_operation_end (NULL);
 			store->dontdistridlehack = FALSE;
 			return;
@@ -3375,12 +3378,14 @@
 
 			g_ptr_array_foreach (needheaders, (GFunc)g_free, NULL);
 			g_ptr_array_free (needheaders, TRUE);
+			camel_operation_unmute (NULL);
 			camel_operation_end (NULL);
 			more = FALSE;
 			camel_folder_summary_kill_hash (folder->summary);
 			store->dontdistridlehack = FALSE;
 			return;
 		}
+		camel_operation_unmute (NULL);
 		camel_operation_end (NULL);
 		more = FALSE;
 		did_hack = TRUE;
@@ -3398,6 +3403,7 @@
 					imap_folder->cancel_occurred = TRUE;
 				else
 					g_warning ("IMAP error getting UIDs (2)");
+				camel_operation_unmute (NULL);
 				camel_operation_end (NULL);
 				store->dontdistridlehack = FALSE;
 				return;
@@ -3416,6 +3422,7 @@
 
 			g_ptr_array_foreach (needheaders, (GFunc)g_free, NULL);
 			g_ptr_array_free (needheaders, TRUE);
+			camel_operation_unmute (NULL);
 			camel_operation_end (NULL);
 			more = FALSE;
 			camel_folder_summary_kill_hash (folder->summary);
@@ -3439,6 +3446,7 @@
 					else
 						g_warning ("IMAP error getting UIDs (3)");
 					camel_folder_summary_kill_hash (folder->summary);
+					camel_operation_unmute (NULL);
 					camel_operation_end (NULL);
 					store->dontdistridlehack = FALSE;
 					return;
@@ -3457,6 +3465,7 @@
 
 				g_ptr_array_foreach (needheaders, (GFunc)g_free, NULL);
 				g_ptr_array_free (needheaders, TRUE);
+				camel_operation_unmute (NULL);
 				camel_operation_end (NULL);
 				more = FALSE;
 				camel_folder_summary_kill_hash (folder->summary);
@@ -3464,6 +3473,7 @@
 				return;
 			}
 		}
+		camel_operation_unmute (NULL);
 		camel_operation_end (NULL);
 		more = FALSE;
 		did_hack = TRUE;
@@ -3496,6 +3506,7 @@
 					g_warning ("IMAP error getting headers (1)");
 				g_ptr_array_foreach (needheaders, (GFunc)g_free, NULL);
 				g_ptr_array_free (needheaders, TRUE);
+				camel_operation_unmute (NULL);
 				camel_operation_end (NULL);
 				g_free (uidset);
 				more = FALSE;
@@ -3606,6 +3617,7 @@
 						{
 							g_ptr_array_foreach (needheaders, (GFunc)g_free, NULL);
 							g_ptr_array_free (needheaders, TRUE);
+							camel_operation_unmute (NULL);
 							camel_operation_end (NULL);
 							g_free (uidset);
 							more = FALSE;
@@ -3642,6 +3654,7 @@
 					g_warning ("IMAP error getting headers (2)");
 				g_ptr_array_foreach (needheaders, (GFunc)g_free, NULL);
 				g_ptr_array_free (needheaders, TRUE);
+				camel_operation_unmute (NULL);
 				camel_operation_end (NULL);
 				more = FALSE;
 				camel_folder_summary_kill_hash (folder->summary);
@@ -3685,6 +3698,7 @@
 
    camel_folder_summary_save (folder->summary, ex);
    camel_folder_summary_kill_hash (folder->summary);
+   camel_operation_unmute (NULL);
    camel_operation_end (NULL);
 
    imap_folder->need_rescan = oldrescval;
Index: ChangeLog
===================================================================
--- ChangeLog	(révision 3820)
+++ ChangeLog	(copie de travail)
@@ -1,6 +1,11 @@
 2008-11-20  Martin Bonnin  <martinbonnin gmail com>
  
 	* camel operation:
+	Unmute the camel_operation before stopping it. Helps for code clarity.
+
+2008-11-20  Martin Bonnin  <martinbonnin gmail com>
+ 
+	* camel operation:
 	adding camel_operation_mute/unmute() and use it to filter the progress
 	events. This prevents to send bad progress when refreshing an IMAP folder
 


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