Patch: tny_enums.h comments and tiny fixes.



I plan to commit this small patch.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
Index: libtinymailui-gtk/tny-gtk-folder-store-tree-model.c
===================================================================
--- libtinymailui-gtk/tny-gtk-folder-store-tree-model.c	(revision 2127)
+++ libtinymailui-gtk/tny-gtk-folder-store-tree-model.c	(working copy)
@@ -588,7 +588,7 @@
 static gboolean 
 updater (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data1)
 {
-	gint type;
+	TnyFolderType type = TNY_FOLDER_TYPE_UNKNOWN;
 	TnyFolderChange *change = user_data1;
 	TnyFolder *changed_folder = tny_folder_change_get_folder (change);
 	TnyFolderChangeChanged changed = tny_folder_change_get_changed (change);
@@ -645,7 +645,7 @@
 deleter (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data1)
 {
 	gboolean retval = FALSE;
-	gint type;
+	TnyFolderType type = TNY_FOLDER_TYPE_UNKNOWN;
 	GObject *folder = user_data1;
 
 	gtk_tree_model_get (model, iter, 
@@ -678,7 +678,7 @@
 	do
 	{
 		GtkTreeIter child;
-		gint type;
+		TnyFolderType type = TNY_FOLDER_TYPE_UNKNOWN;
 		TnyFolderStore *fol;
 		gboolean found = FALSE;
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 2127)
+++ ChangeLog	(working copy)
@@ -1,3 +1,16 @@
+2007-06-12  Murray Cumming  <murrayc murrayc com>
+
+	* libtinymail/tny-enums.h: Resynced the fake TnyFolderType enum values 
+	from tnyfolder.h and added comments explaining why we have these fake 
+	uninstalled enums for gtk-doc, with a link to the gtk-doc bug.
+	
+	* libtinymail/tny-folder.c:
+	* libtinymailui-gtk/tny-gtk-folder-store-tree-model.c: (updater),
+	(deleter), (find_store_iter): Use TnyFolderType instead of gint when 
+	using this column, and initialize it, rather than depending on 
+	gtk_tree_model_get() to initialize it. The compiler can't detect these 
+	possible unitialized uses.
+
 2007-06-12  Philip Van Hoof  <pvanhoof gnome org>
 
 	* Configurable idle delays
Index: libtinymail/tny-enums.h
===================================================================
--- libtinymail/tny-enums.h	(revision 2127)
+++ libtinymail/tny-enums.h	(working copy)
@@ -1,6 +1,15 @@
 #ifdef TNY_ENUMS_H
 
-/* These are fakes for gtk-doc */
+/* These are fakes for gtk-doc.
+ * This file is not installed and should not be included.
+ * 
+ * These are duplicates of the same enums from tny-folder.h,
+ * because gtk-doc does not like the (e.g. "enum _TnyFolderType") 
+ * way that enum are defined in the main headers
+ * (http://bugzilla.gnome.org/show_bug.cgi?id=446648) 
+ * and Philip prefers to duplicate it and try to keep it in sync
+ * rather than adapt to what gtk-doc demands, or it cannot be adapted.
+ */
 
 G_BEGIN_DECLS
 
@@ -139,7 +148,15 @@
 	TNY_FOLDER_TYPE_TRASH,
 	TNY_FOLDER_TYPE_JUNK,
 	TNY_FOLDER_TYPE_SENT,
-	TNY_FOLDER_TYPE_ROOT
+	TNY_FOLDER_TYPE_ROOT,
+	TNY_FOLDER_TYPE_NOTES,
+	TNY_FOLDER_TYPE_DRAFTS,
+	TNY_FOLDER_TYPE_CONTACTS,
+	TNY_FOLDER_TYPE_CALENDAR,
+	TNY_FOLDER_TYPE_ARCHIVE,
+	TNY_FOLDER_TYPE_MERGE,
+
+	TNY_FOLDER_TYPE_NUM
 } TnyFolderType;
 
 G_END_DECLS
Index: libtinymail/tny-folder.c
===================================================================
--- libtinymail/tny-folder.c	(revision 2127)
+++ libtinymail/tny-folder.c	(working copy)
@@ -1200,6 +1200,11 @@
  * @self: a TnyFolder object
  * 
  * Get the type of @self (Inbox, Outbox etc.) 
+ * Most implementations decide the type by comparing the name of the folder 
+ * with some hardcoded values.
+ * Some implementations (such as camel) might not provide precise information 
+ * before a connection has been made. For instance, the return value might 
+ * be TNY_FOLDER_TYPE_NORMAL rather than TNY_FOLDER_TYPE_SENT.
  * 
  * Return value: The folder type as a #TnyFolderType enum
  **/


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