Almost trivial fix



Hi,

find attached the fix to the issue described here:
http://tinymail.org/trac/tinymail/ticket/35

There were some possible fixes, I just took one, to add an if.

Take into account that there is still a problem (talking from MUA
developer POV) the exception is lost in this method, so there is no way
in the client to know what happened.

Br
Index: tny-camel-folder.c
===================================================================
--- tny-camel-folder.c	(revision 1721)
+++ tny-camel-folder.c	(working copy)
@@ -277,29 +277,32 @@
 		priv->folder = camel_store_get_folder 
 			(store, priv->folder_name, 0, &ex);
 
-		if (priv->folder->folder_flags & CAMEL_FOLDER_IS_READONLY)
-			priv->caps &= ~TNY_FOLDER_CAPS_WRITABLE;
-		else
-			priv->caps |= TNY_FOLDER_CAPS_WRITABLE;
+		if (priv->folder && !camel_exception_is_set (&ex) && CAMEL_IS_FOLDER (priv->folder)) {
 
-		if (priv->folder->folder_flags & CAMEL_FOLDER_HAS_PUSHEMAIL_CAPABILITY)
-			priv->caps |= TNY_FOLDER_CAPS_PUSHEMAIL;
-		else
-			priv->caps &= ~TNY_FOLDER_CAPS_PUSHEMAIL;
+			if (priv->folder->folder_flags & CAMEL_FOLDER_IS_READONLY)
+				priv->caps &= ~TNY_FOLDER_CAPS_WRITABLE;
+			else
+				priv->caps |= TNY_FOLDER_CAPS_WRITABLE;
 
-		/* printf ("LOAD (%s): %d\n",
-				priv->folder_name?priv->folder_name:"NUL",
-				(((CamelObject*)priv->folder)->ref_count)); */
+			if (priv->folder->folder_flags & CAMEL_FOLDER_HAS_PUSHEMAIL_CAPABILITY)
+				priv->caps |= TNY_FOLDER_CAPS_PUSHEMAIL;
+			else
+				priv->caps &= ~TNY_FOLDER_CAPS_PUSHEMAIL;
 
-		if (!priv->iter || !priv->iter->name || strcmp (priv->iter->full_name, priv->folder_name) != 0)
-		{
-			guint32 flags = CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL;
+			/* printf ("LOAD (%s): %d\n",
+			   priv->folder_name?priv->folder_name:"NUL",
+			   (((CamelObject*)priv->folder)->ref_count)); */
 
-			if (priv->iter && !priv->iter_parented)
-				camel_folder_info_free  (priv->iter);
+			if (!priv->iter || !priv->iter->name || strcmp (priv->iter->full_name, priv->folder_name) != 0)
+				{
+					guint32 flags = CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL;
 
-			priv->iter = camel_store_get_folder_info (store, priv->folder_name, flags, &ex);
-			priv->iter_parented = TRUE;
+					if (priv->iter && !priv->iter_parented)
+						camel_folder_info_free  (priv->iter);
+
+					priv->iter = camel_store_get_folder_info (store, priv->folder_name, flags, &ex);
+					priv->iter_parented = TRUE;
+				}
 


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