[evolution-data-server] Bug 776258 - Make CamelFolderThread a boxed type



commit 096aae099a7f2f3bd2cf0a9527954022d44d33a1
Author: Corentin Noël <corentin elementary io>
Date:   Mon Dec 19 19:10:39 2016 +0100

    Bug 776258 - Make CamelFolderThread a boxed type

 src/camel/camel-folder-thread.c |   18 ++++++++++++++++--
 src/camel/camel-folder-thread.h |    3 ++-
 2 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/src/camel/camel-folder-thread.c b/src/camel/camel-folder-thread.c
index e0b97cd..ae9fef7 100644
--- a/src/camel/camel-folder-thread.c
+++ b/src/camel/camel-folder-thread.c
@@ -40,6 +40,11 @@
 #include <sys/time.h>
 #endif
 
+G_DEFINE_BOXED_TYPE (CamelFolderThread,
+               camel_folder_thread_messages,
+               camel_folder_thread_messages_ref,
+               camel_folder_thread_messages_unref)
+
 static void
 container_add_child (CamelFolderThreadNode *node,
                      CamelFolderThreadNode *child)
@@ -649,7 +654,7 @@ thread_summary (CamelFolderThread *thread,
 }
 
 /**
- * camel_folder_thread_messages_new: (skip)
+ * camel_folder_thread_messages_new:
  * @folder: a #CamelFolder
  * @uids: (element-type utf8): The subset of uid's to thread. If %NULL, then thread
  *    all UID-s in the @folder
@@ -778,10 +783,19 @@ camel_folder_thread_messages_apply (CamelFolderThread *thread,
        thread->summary = all;
 }
 
-void
+/**
+ * camel_folder_thread_messages_ref:
+ * @thread: a #CamelFolderThread
+ *
+ * Increase the reference of @thread
+ *
+ * Returns: the referenced @thread
+ **/
+CamelFolderThread *
 camel_folder_thread_messages_ref (CamelFolderThread *thread)
 {
        thread->refcount++;
+       return thread;
 }
 
 /**
diff --git a/src/camel/camel-folder-thread.h b/src/camel/camel-folder-thread.h
index 88cfac5..23334c8 100644
--- a/src/camel/camel-folder-thread.h
+++ b/src/camel/camel-folder-thread.h
@@ -48,6 +48,7 @@ typedef struct _CamelFolderThread {
        GPtrArray *summary;
 } CamelFolderThread;
 
+GType          camel_folder_thread_messages_get_type           (void);
 /* interface 1: using uid's */
 CamelFolderThread *camel_folder_thread_messages_new (CamelFolder *folder, GPtrArray *uids, gboolean 
thread_subject);
 void camel_folder_thread_messages_apply (CamelFolderThread *thread, GPtrArray *uids);
@@ -60,7 +61,7 @@ void camel_folder_thread_messages_add (CamelFolderThread *thread, GPtrArray *sum
 void camel_folder_thread_messages_remove (CamelFolderThread *thread, GPtrArray *uids);
 #endif
 
-void camel_folder_thread_messages_ref (CamelFolderThread *thread);
+CamelFolderThread *camel_folder_thread_messages_ref (CamelFolderThread *thread);
 void camel_folder_thread_messages_unref (CamelFolderThread *thread);
 
 /* debugging function only */


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