[Evolution-hackers] [CamelStore] clarifying of documentation becomes a minor change of code

2008-09-01 Thread Paul Bolle
I wanted to clarify the documentation for camel_store_free_folder_info()
a bit. In found myself altering its implementation. Rationale is
(obviously) to simply make sure that camel_store_free_folder_info()
handles a NULL return of camel_store_get_folder_info() gracefully so my
documentation change is actually always correct. Any comments on this
(entirely untested) change before spamming b.g.o.?

Paul
---
Index: camel/camel-store.c
===
--- camel/camel-store.c (revision 9463)
+++ camel/camel-store.c (working copy)
@@ -882,11 +882,15 @@
  * @store: a #CamelStore object
  * @fi: a #CamelFolderInfo as gotten via #camel_store_get_folder_info
  *
- * Frees the data returned by #camel_store_get_folder_info
+ * Frees the data returned by #camel_store_get_folder_info. If @fi is %NULL,
+ * nothing is done, the routine simply returns.
  **/
 void
 camel_store_free_folder_info (CamelStore *store, CamelFolderInfo *fi)
 {
+   if (!fi)
+   return;
+
g_return_if_fail (CAMEL_IS_STORE (store));
 
CS_CLASS (store)-free_folder_info (store, fi);


___
Evolution-hackers mailing list
Evolution-hackers@gnome.org
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] [CamelStore] clarifying of documentation becomes a minor change of code

2008-09-01 Thread Jeffrey Stedfast
On Mon, 2008-09-01 at 18:19 +0200, Paul Bolle wrote:
[snip]
  void
  camel_store_free_folder_info (CamelStore *store, CamelFolderInfo *fi)
  {
 + if (!fi)
 + return;
 +

that null-check should probably go after the g_return below:

   g_return_if_fail (CAMEL_IS_STORE (store));
  
   CS_CLASS (store)-free_folder_info (store, fi);
 

other than that, it's ok with me.

Jeff


___
Evolution-hackers mailing list
Evolution-hackers@gnome.org
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] [CamelStore] clarifying of documentation becomes a minor change of code

2008-09-01 Thread Paul Bolle
On Mon, 2008-09-01 at 16:46 -0400, Jeffrey Stedfast wrote:
 On Mon, 2008-09-01 at 18:19 +0200, Paul Bolle wrote:

Viewing this message's subject actually renders a tab between [...] of
and code. This tab was inserted (I suppose by evolution) because the
Subject header wrapped some magic line length (78? 80?).

Evolution shouldn't do that. Known bug? Andre? 


Paul

___
Evolution-hackers mailing list
Evolution-hackers@gnome.org
http://mail.gnome.org/mailman/listinfo/evolution-hackers