/soc/2013/ankitkv/gobjectification: 5bbf6b8c30fd: Merged default...

Ankit Vani a at nevitus.org
Thu Feb 20 16:22:39 EST 2014


Changeset: 5bbf6b8c30fd5ad40856b2f711f9f72c0f2a793b
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-02-21 02:52 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/5bbf6b8c30fd

Description:

Merged default branch

diffstat:

 README.hg                 |  12 ++++++------
 finch/libgnt/gntfilesel.c |  33 +++++++++++++++++++++++++++++++++
 finch/libgnt/gntfilesel.h |   9 +++++++++
 finch/libgnt/gnttree.c    |  29 +++++++++++++++++++++++++++++
 finch/libgnt/gnttree.h    |   9 +++++++++
 libpurple/buddylist.c     |   2 +-
 6 files changed, 87 insertions(+), 7 deletions(-)

diffs (170 lines):

diff --git a/README.hg b/README.hg
--- a/README.hg
+++ b/README.hg
@@ -19,12 +19,12 @@ If you are interested in hacking on Pidg
 check out the information available at: https://developer.pidgin.im
 
 By far the best documentation, however, is the documented code.  You can pass
-"--enable-gtk-doc" to ./configure before running "make" in the source tree to
-generate pretty documentation using gtk-doc.  Otherwise (or even if you do!),
-the header files for each subsystem contain documentation for the functions they
-contain.  For instance, conversation.h contains documentation for the entire
-purple_conversation_* API, and account.h contains documentation for the
-purple_account_* API.
+"--enable-gtk-doc" to ./configure then run "make" in the source tree to
+generate pretty documentation in the doc/reference/*/html directories.
+Otherwise (or even if you do!), the header files for each subsystem contain
+documentation for the functions they contain.  For instance, conversation.h
+contains documentation for the entire purple_conversation_* API, and account.h
+contains documentation for the purple_account_* API.
 
 If you have questions, please feel free to contact the Pidgin, Finch, and
 libpurple developers by email at devel at pidgin.im or on IRC at irc.freenode.net
diff --git a/finch/libgnt/gntfilesel.c b/finch/libgnt/gntfilesel.c
--- a/finch/libgnt/gntfilesel.c
+++ b/finch/libgnt/gntfilesel.c
@@ -184,6 +184,8 @@ local_read_fn(const char *path, GList **
 static void
 gnt_file_free(GntFile *file)
 {
+	g_return_if_fail(file != NULL);
+
 	g_free(file->fullpath);
 	g_free(file->basename);
 	g_free(file);
@@ -685,4 +687,35 @@ void gnt_file_sel_set_read_fn(GntFileSel
 	sel->read_fn = read_fn;
 }
 
+/**************************************************************************
+ * GntFile GBoxed API
+ **************************************************************************/
+static GntFile *
+gnt_file_copy(GntFile *file)
+{
+	GntFile *file_new;
 
+	g_return_val_if_fail(file != NULL, NULL);
+
+	file_new = g_new(GntFile, 1);
+	*file_new = *file;
+
+	file_new->fullpath = g_strdup(file->fullpath);
+	file_new->basename = g_strdup(file->basename);
+
+	return file_new;
+}
+
+GType
+gnt_file_get_type(void)
+{
+	static GType type = 0;
+
+	if (type == 0) {
+		type = g_boxed_type_register_static("GntFile",
+				(GBoxedCopyFunc)gnt_file_copy,
+				(GBoxedFreeFunc)gnt_file_free);
+	}
+
+	return type;
+}
diff --git a/finch/libgnt/gntfilesel.h b/finch/libgnt/gntfilesel.h
--- a/finch/libgnt/gntfilesel.h
+++ b/finch/libgnt/gntfilesel.h
@@ -45,6 +45,8 @@
 #define GNT_FILE_SEL_SET_FLAGS(obj, flags)		(GNT_FILE_SEL_FLAGS(obj) |= flags)
 #define GNT_FILE_SEL_UNSET_FLAGS(obj, flags)	(GNT_FILE_SEL_FLAGS(obj) &= ~(flags))
 
+#define GNT_TYPE_FILE					(gnt_file_get_type())
+
 typedef struct _GntFileSel			GntFileSel;
 typedef struct _GntFileSelPriv		GntFileSelPriv;
 typedef struct _GntFileSelClass		GntFileSelClass;
@@ -109,6 +111,13 @@ G_BEGIN_DECLS
 GType gnt_file_sel_get_type(void);
 
 /**
+ * gnt_file_get_type:
+ *
+ * Returns: The #GType for the #GntFile boxed structure.
+ */
+GType gnt_file_get_type(void);
+
+/**
  * gnt_file_sel_new:
  *
  * Create a new file selector.
diff --git a/finch/libgnt/gnttree.c b/finch/libgnt/gnttree.c
--- a/finch/libgnt/gnttree.c
+++ b/finch/libgnt/gnttree.c
@@ -1955,3 +1955,32 @@ GntTreeRow * gnt_tree_row_get_parent(Gnt
 	return row->parent;
 }
 
+/**************************************************************************
+ * GntTreeRow GBoxed API
+ **************************************************************************/
+static GntTreeRow *
+copy_tree_row(GntTreeRow *row)
+{
+	GntTreeRow *row_new;
+
+	g_return_val_if_fail(row != NULL, NULL);
+
+	row_new = g_new(GntTreeRow, 1);
+	*row_new = *row;
+
+	return row_new;
+}
+
+GType
+gnt_tree_row_get_type(void)
+{
+	static GType type = 0;
+
+	if (type == 0) {
+		type = g_boxed_type_register_static("GntTreeRow",
+				(GBoxedCopyFunc)copy_tree_row,
+				(GBoxedFreeFunc)free_tree_row);
+	}
+
+	return type;
+}
diff --git a/finch/libgnt/gnttree.h b/finch/libgnt/gnttree.h
--- a/finch/libgnt/gnttree.h
+++ b/finch/libgnt/gnttree.h
@@ -42,6 +42,8 @@
 #define GNT_IS_TREE_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_TREE))
 #define GNT_TREE_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_TREE, GntTreeClass))
 
+#define GNT_TYPE_TREE_ROW			(gnt_tree_row_get_type())
+
 typedef guint (*GntTreeHashFunc)(gconstpointer);
 typedef gboolean (*GntTreeHashEqualityFunc)(gconstpointer, gconstpointer);
 
@@ -118,6 +120,13 @@ G_BEGIN_DECLS
 GType gnt_tree_get_type(void);
 
 /**
+ * gnt_tree_row_get_type:
+ *
+ * Returns: The #GType for the #GntTreeRow boxed structure.
+ */
+GType gnt_tree_row_get_type(void);
+
+/**
  * gnt_tree_new:
  *
  * Create a tree with one column.
diff --git a/libpurple/buddylist.c b/libpurple/buddylist.c
--- a/libpurple/buddylist.c
+++ b/libpurple/buddylist.c
@@ -1364,7 +1364,7 @@ void purple_blist_remove_buddy(PurpleBud
 		if (PURPLE_BUDDY_IS_ONLINE(buddy)) {
 			purple_counting_node_change_online_count(contact_counter, -1);
 			if (purple_counting_node_get_online_count(contact_counter) == 0)
-				purple_counting_node_set_online_count(group_counter, -1);
+				purple_counting_node_change_online_count(group_counter, -1);
 		}
 		if (purple_account_is_connected(account)) {
 			purple_counting_node_change_current_size(contact_counter, -1);



More information about the Commits mailing list