/soc/2013/ankitkv/gobjectification: 7a89045601ae: Refactored log...

Ankit Vani a at nevitus.org
Wed Jul 17 18:25:41 EDT 2013


Changeset: 7a89045601aebf4cb3b094c91a528a45a2d3f849
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-07-18 03:55 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/7a89045601ae

Description:

Refactored log, network, notify to use GType instead of PurpleValue

diffstat:

 libpurple/log.c     |  11 +++++------
 libpurple/network.c |   2 +-
 libpurple/notify.c  |  28 ++++++++++------------------
 3 files changed, 16 insertions(+), 25 deletions(-)

diffs (82 lines):

diff --git a/libpurple/log.c b/libpurple/log.c
--- a/libpurple/log.c
+++ b/libpurple/log.c
@@ -700,17 +700,16 @@ void purple_log_init(void)
 #else
 #error Unknown size of time_t
 #endif
-	                     purple_value_new(PURPLE_TYPE_STRING), 3,
-	                     purple_value_new(PURPLE_TYPE_SUBTYPE,
-	                                    PURPLE_SUBTYPE_LOG),
+	                     G_TYPE_STRING, 3,
+	                     PURPLE_TYPE_LOG,
 #if SIZEOF_TIME_T == 4
-	                     purple_value_new(PURPLE_TYPE_INT),
+	                     G_TYPE_INT,
 #elif SIZEOF_TIME_T == 8
-	                     purple_value_new(PURPLE_TYPE_INT64),
+	                     G_TYPE_INT64,
 #else
 # error Unknown size of time_t
 #endif
-	                     purple_value_new(PURPLE_TYPE_BOOLEAN));
+	                     G_TYPE_BOOLEAN);
 
 	purple_prefs_connect_callback(NULL, "/purple/logging/format",
 							    logger_pref_cb, NULL);
diff --git a/libpurple/network.c b/libpurple/network.c
--- a/libpurple/network.c
+++ b/libpurple/network.c
@@ -1221,7 +1221,7 @@ purple_network_init(void)
 #endif
 
 	purple_signal_register(purple_network_get_handle(), "network-configuration-changed",
-						   purple_marshal_VOID, NULL, 0);
+						   purple_marshal_VOID, G_TYPE_NONE, 0);
 
 	purple_pmp_init();
 	purple_upnp_init();
diff --git a/libpurple/notify.c b/libpurple/notify.c
--- a/libpurple/notify.c
+++ b/libpurple/notify.c
@@ -840,30 +840,22 @@ purple_notify_init(void)
 	gpointer handle = purple_notify_get_handle();
 
 	purple_signal_register(handle, "displaying-email-notification",
-						 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER, NULL, 4,
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_STRING));
+						 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER,
+						 G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_STRING,
+						 G_TYPE_STRING, G_TYPE_STRING);
 
 	purple_signal_register(handle, "displaying-emails-notification",
-						 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT, NULL, 5,
-						 purple_value_new(PURPLE_TYPE_POINTER),
-						 purple_value_new(PURPLE_TYPE_POINTER),
-						 purple_value_new(PURPLE_TYPE_POINTER),
-						 purple_value_new(PURPLE_TYPE_POINTER),
-						 purple_value_new(PURPLE_TYPE_UINT));
+						 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
+						 G_TYPE_NONE, 5, G_TYPE_POINTER, G_TYPE_POINTER,
+						 G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_UINT);
 
 	purple_signal_register(handle, "displaying-emails-clear",
-						 purple_marshal_VOID, NULL, 0);
+						 purple_marshal_VOID, G_TYPE_NONE, 0);
 
 	purple_signal_register(handle, "displaying-userinfo",
-						 purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_ACCOUNT),
-						 purple_value_new(PURPLE_TYPE_STRING),
-						 purple_value_new(PURPLE_TYPE_SUBTYPE,
-										PURPLE_SUBTYPE_USERINFO));
+						 purple_marshal_VOID__POINTER_POINTER_POINTER,
+						 G_TYPE_NONE, 3, PURPLE_TYPE_ACCOUNT, G_TYPE_STRING,
+						 PURPLE_TYPE_NOTIFY_USER_INFO);
 }
 
 void



More information about the Commits mailing list