/soc/2013/ankitkv/gobjectification: 908a67a0072a: Added signals ...

Ankit Vani a at nevitus.org
Tue Sep 3 07:09:27 EDT 2013


Changeset: 908a67a0072a7525380485bb69384fefedc53150
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-03 16:39 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/908a67a0072a

Description:

Added signals "protocol-added" and "protocol-removed"

diffstat:

 libpurple/protocols.c |  15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diffs (41 lines):

diff --git a/libpurple/protocols.c b/libpurple/protocols.c
--- a/libpurple/protocols.c
+++ b/libpurple/protocols.c
@@ -823,6 +823,9 @@ purple_protocols_add(GType protocol_type
 
 	g_hash_table_insert(protocols, g_strdup(purple_protocol_get_id(protocol)),
 	                    protocol);
+
+	purple_signal_emit(purple_protocols_get_handle(), "protocol-added",
+	                   protocol);
 	return protocol;
 }
 
@@ -839,6 +842,9 @@ gboolean purple_protocols_remove(PurpleP
 		return FALSE;
 	}
 
+	purple_signal_emit(purple_protocols_get_handle(), "protocol-removed",
+	                   protocol);
+
 	g_hash_table_remove(protocols, purple_protocol_get_id(protocol));
 	return TRUE;
 }
@@ -863,8 +869,17 @@ purple_protocols_get_all(void)
 void
 purple_protocols_init(void)
 {
+	void *handle = purple_protocols_get_handle();
+
 	protocols = g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
 			(GDestroyNotify)g_object_unref);
+
+	purple_signal_register(handle, "protocol-added",
+	                       purple_marshal_VOID__POINTER,
+	                       G_TYPE_NONE, 1, PURPLE_TYPE_PROTOCOL);
+	purple_signal_register(handle, "protocol-removed",
+	                       purple_marshal_VOID__POINTER,
+	                       G_TYPE_NONE, 1, PURPLE_TYPE_PROTOCOL);
 }
 
 void *



More information about the Commits mailing list