/pidgin/main: 5f0d2faa75ad: Merged in rw_grim/pidgin (pull reque...

Gary Kramlich <[email protected]> Thu, 25 Aug 2016 23:54:13 -0400
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 5f0d2faa75adc9e0e07b84c7ef64e4a7cf5e10b7
Author:	 Gary Kramlich <[email protected]>
Date:	 2016-08-25 22:53 -0500
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/5f0d2faa75ad

Description:

Merged in rw_grim/pidgin (pull request #94)

Split blist classes out to their own files

diffstat:

 libpurple/Makefile.am                   |    14 +-
 libpurple/blistnode.c                   |   239 ------
 libpurple/blistnode.h                   |   163 +----
 libpurple/buddy.c                       |  1229 ++----------------------------
 libpurple/buddy.h                       |   368 +--------
 libpurple/buddylist.h                   |     4 +-
 libpurple/chat.c                        |   337 ++++++++
 libpurple/chat.h                        |   153 +++
 libpurple/contact.c                     |   388 +++++++++
 libpurple/contact.h                     |   167 ++++
 libpurple/countingnode.c                |   265 ++++++
 libpurple/countingnode.h                |   184 ++++
 libpurple/group.c                       |   389 +++++++++
 libpurple/group.h                       |   151 +++
 libpurple/protocols/facebook/data.h     |     1 -
 libpurple/protocols/facebook/facebook.c |     2 +-
 libpurple/protocols/facebook/util.c     |     1 -
 libpurple/server.h                      |     1 +
 18 files changed, 2169 insertions(+), 1887 deletions(-)

diffs (truncated from 4506 to 300 lines):

diff --git a/libpurple/Makefile.am b/libpurple/Makefile.am
--- a/libpurple/Makefile.am
+++ b/libpurple/Makefile.am
@@ -41,9 +41,10 @@ purple_coresources = \
 	accounts.c \
 	accountopt.c \
 	blistnode.c \
-	blistnodetypes.c \
+	buddy.c \
 	buddylist.c \
 	buddyicon.c \
+	chat.c \
 	ciphers/aescipher.c \
 	ciphers/descipher.c \
 	ciphers/des3cipher.c \
@@ -58,13 +59,16 @@ purple_coresources = \
 	circularbuffer.c \
 	cmds.c \
 	connection.c \
+	contact.c \
 	conversation.c \
 	conversationtypes.c \
 	conversations.c \
 	core.c \
+	countingnode.c \
 	debug.c \
 	e2ee.c \
 	eventloop.c \
+	group.c \
 	http.c \
 	idle.c \
 	image.c \
@@ -135,21 +139,25 @@ purple_coreheaders = \
 	accounts.h \
 	accountopt.h \
 	blistnode.h \
-	blistnodetypes.h \
+	buddy.h \
 	buddylist.h \
 	buddyicon.h \
+	chat.h \
 	cipher.h \
 	circularbuffer.h \
 	cmds.h \
 	connection.h \
+	contact.h \
 	conversation.h \
 	conversationtypes.h \
 	conversations.h \
 	core.h \
+	countingnode.h \
 	dbus-maybe.h \
 	debug.h \
 	e2ee.h \
 	eventloop.h \
+	group.h \
 	http.h \
 	idle.h \
 	image.h \
@@ -309,7 +317,7 @@ dbus_sources  = dbus-server.c dbus-usefu
 dbus_headers  = dbus-server.h dbus-bindings.h dbus-purple.h dbus-useful.h dbus-define-api.h dbus-types.h
 
 dbus_exported = dbus-useful.h dbus-define-api.h account.h accounts.h blistnode.h \
-                blistnodetypes.h buddylist.h buddyicon.h connection.h conversation.h \
+                buddy.h buddylist.h buddyicon.h connection.h conversation.h \
                 conversationtypes.h conversations.h core.h xfer.h log.h notify.h \
                 prefs.h presence.h roomlist.h savedstatuses.h smiley.h smiley-list.h \
 				status.h server.h util.h xmlnode.h protocol.h protocols.h
diff --git a/libpurple/blistnode.c b/libpurple/blistnode.c
--- a/libpurple/blistnode.c
+++ b/libpurple/blistnode.c
@@ -22,18 +22,12 @@
  */
 #include "internal.h"
 #include "glibcompat.h"
-#include "blistnodetypes.h"
 
 #define PURPLE_BLIST_NODE_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_BLIST_NODE, PurpleBlistNodePrivate))
 
 typedef struct _PurpleBlistNodePrivate  PurpleBlistNodePrivate;
 
-#define PURPLE_COUNTING_NODE_GET_PRIVATE(obj) \
-	(G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_COUNTING_NODE, PurpleCountingNodePrivate))
-
-typedef struct _PurpleCountingNodePrivate  PurpleCountingNodePrivate;
-
 /* Private data of a buddy list node */
 struct _PurpleBlistNodePrivate {
 	GHashTable *settings;  /* per-node settings                            */
@@ -48,29 +42,9 @@ enum
 	BLNODE_PROP_LAST
 };
 
-/* Private data of a counting node */
-struct _PurpleCountingNodePrivate {
-	int totalsize;    /* The number of children under this node            */
-	int currentsize;  /* The number of children under this node
-	                     corresponding to online accounts                  */
-	int onlinecount;  /* The number of children under this contact who are
-	                     currently online                                  */
-};
-
-/* Counting node property enums */
-enum
-{
-	CNODE_PROP_0,
-	CNODE_PROP_TOTAL_SIZE,
-	CNODE_PROP_CURRENT_SIZE,
-	CNODE_PROP_ONLINE_COUNT,
-	CNODE_PROP_LAST
-};
-
 static GObjectClass *parent_class;
 
 static GParamSpec *bn_properties[BLNODE_PROP_LAST];
-static GParamSpec *cn_properties[CNODE_PROP_LAST];
 
 /**************************************************************************/
 /* Buddy list node API                                                    */
@@ -447,216 +421,3 @@ purple_blist_node_get_type(void)
 	return type;
 }
 
-/**************************************************************************/
-/* Counting node API                                                      */
-/**************************************************************************/
-
-int
-purple_counting_node_get_total_size(PurpleCountingNode *counter)
-{
-	PurpleCountingNodePrivate *priv = PURPLE_COUNTING_NODE_GET_PRIVATE(counter);
-
-	g_return_val_if_fail(priv != NULL, -1);
-
-	return priv->totalsize;
-}
-
-int
-purple_counting_node_get_current_size(PurpleCountingNode *counter)
-{
-	PurpleCountingNodePrivate *priv = PURPLE_COUNTING_NODE_GET_PRIVATE(counter);
-
-	g_return_val_if_fail(priv != NULL, -1);
-
-	return priv->currentsize;
-}
-
-int
-purple_counting_node_get_online_count(PurpleCountingNode *counter)
-{
-	PurpleCountingNodePrivate *priv = PURPLE_COUNTING_NODE_GET_PRIVATE(counter);
-
-	g_return_val_if_fail(priv != NULL, -1);
-
-	return priv->onlinecount;
-}
-
-void
-purple_counting_node_change_total_size(PurpleCountingNode *counter, int delta)
-{
-	PurpleCountingNodePrivate *priv = PURPLE_COUNTING_NODE_GET_PRIVATE(counter);
-
-	g_return_if_fail(priv != NULL);
-
-	purple_counting_node_set_total_size(counter, priv->totalsize + delta);
-}
-
-void
-purple_counting_node_change_current_size(PurpleCountingNode *counter, int delta)
-{
-	PurpleCountingNodePrivate *priv = PURPLE_COUNTING_NODE_GET_PRIVATE(counter);
-
-	g_return_if_fail(priv != NULL);
-
-	purple_counting_node_set_current_size(counter, priv->currentsize + delta);
-}
-
-void
-purple_counting_node_change_online_count(PurpleCountingNode *counter, int delta)
-{
-	PurpleCountingNodePrivate *priv = PURPLE_COUNTING_NODE_GET_PRIVATE(counter);
-
-	g_return_if_fail(priv != NULL);
-
-	purple_counting_node_set_online_count(counter, priv->onlinecount + delta);
-}
-
-void
-purple_counting_node_set_total_size(PurpleCountingNode *counter, int totalsize)
-{
-	PurpleCountingNodePrivate *priv = PURPLE_COUNTING_NODE_GET_PRIVATE(counter);
-
-	g_return_if_fail(priv != NULL);
-
-	priv->totalsize = totalsize;
-
-	g_object_notify_by_pspec(G_OBJECT(counter),
-			cn_properties[CNODE_PROP_TOTAL_SIZE]);
-}
-
-void
-purple_counting_node_set_current_size(PurpleCountingNode *counter, int currentsize)
-{
-	PurpleCountingNodePrivate *priv = PURPLE_COUNTING_NODE_GET_PRIVATE(counter);
-
-	g_return_if_fail(priv != NULL);
-
-	priv->currentsize = currentsize;
-
-	g_object_notify_by_pspec(G_OBJECT(counter),
-			cn_properties[CNODE_PROP_CURRENT_SIZE]);
-}
-
-void
-purple_counting_node_set_online_count(PurpleCountingNode *counter, int onlinecount)
-{
-	PurpleCountingNodePrivate *priv = PURPLE_COUNTING_NODE_GET_PRIVATE(counter);
-
-	g_return_if_fail(priv != NULL);
-
-	priv->onlinecount = onlinecount;
-
-	g_object_notify_by_pspec(G_OBJECT(counter),
-			cn_properties[CNODE_PROP_ONLINE_COUNT]);
-}
-
-/**************************************************************************
- * GObject code for PurpleCountingNode
- **************************************************************************/
- 
-/* Set method for GObject properties */
-static void
-purple_counting_node_set_property(GObject *obj, guint param_id, const GValue *value,
-		GParamSpec *pspec)
-{
-	PurpleCountingNode *node = PURPLE_COUNTING_NODE(obj);
-
-	switch (param_id) {
-		case CNODE_PROP_TOTAL_SIZE:
-			purple_counting_node_set_total_size(node, g_value_get_int(value));
-			break;
-		case CNODE_PROP_CURRENT_SIZE:
-			purple_counting_node_set_current_size(node, g_value_get_int(value));
-			break;
-		case CNODE_PROP_ONLINE_COUNT:
-			purple_counting_node_set_online_count(node, g_value_get_int(value));
-			break;
-		default:
-			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
-			break;
-	}
-}
-
-/* Get method for GObject properties */
-static void
-purple_counting_node_get_property(GObject *obj, guint param_id, GValue *value,
-		GParamSpec *pspec)
-{
-	PurpleCountingNode *node = PURPLE_COUNTING_NODE(obj);
-
-	switch (param_id) {
-		case CNODE_PROP_TOTAL_SIZE:
-			g_value_set_int(value, purple_counting_node_get_total_size(node));
-			break;
-		case CNODE_PROP_CURRENT_SIZE:
-			g_value_set_int(value, purple_counting_node_get_current_size(node));
-			break;
-		case CNODE_PROP_ONLINE_COUNT:
-			g_value_set_int(value, purple_counting_node_get_online_count(node));
-			break;
-		default:
-			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
-			break;
-	}
-}
-
-/* Class initializer function */
-static void
-purple_counting_node_class_init(PurpleCountingNodeClass *klass)
-{
-	GObjectClass *obj_class = G_OBJECT_CLASS(klass);
-
-	/* Setup properties */
-	obj_class->get_property = purple_counting_node_get_property;
-	obj_class->set_property = purple_counting_node_set_property;
-
-	g_type_class_add_private(klass, sizeof(PurpleCountingNodePrivate));
-
-	cn_properties[CNODE_PROP_TOTAL_SIZE] = g_param_spec_int("total-size",
-				"Total size",
-				"The number of children under this node.",
-				G_MININT, G_MAXINT, 0, G_PARAM_READWRITE |
-				G_PARAM_STATIC_STRINGS);
-
-	cn_properties[CNODE_PROP_CURRENT_SIZE] = g_param_spec_int("current-size",
-				"Current size",
-				"The number of children with online accounts.",
-				G_MININT, G_MAXINT, 0, G_PARAM_READWRITE |
-				G_PARAM_STATIC_STRINGS);

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits