gobjectification: 1dfb6c9f: Moved BList init into class init

aluink at soc.pidgin.im aluink at soc.pidgin.im
Thu Jun 25 16:55:23 EDT 2009


-----------------------------------------------------------------
Revision: 1dfb6c9f81757d612bf7a3f3a7f5fcc63b09d790
Ancestor: c4253bf5ddcc0ba68b4e1e24b3787dbb5bfc21da
Author: aluink at soc.pidgin.im
Date: 2009-06-25T17:35:49
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/1dfb6c9f81757d612bf7a3f3a7f5fcc63b09d790

Modified files:
        libpurple/blist.c libpurple/core.c

ChangeLog: 

Moved BList init into class init

-------------- next part --------------
============================================================
--- libpurple/blist.c	10e7e1e0a14cd94f1f9d246f8550ef1b83d82d95
+++ libpurple/blist.c	848dbef53512b4331a50101522d658751b14c978
@@ -300,11 +300,6 @@ purple_blist_load()
 }
 
 
-/*********************************************************************
- * Stuff                                                             *
- *********************************************************************/
-
-
 /*****************************************************************************
  * Public API functions                                                      *
  *****************************************************************************/
@@ -1107,11 +1102,61 @@ void
 }
 
 void
-purple_blist_init(void)
+purple_blist_uninit(void)
 {
-  #warning: Should this be moved to the PurpleBlistClass init func?
-	void *handle = purple_blist_get_handle();
+	PurpleBlistNode *node, *next_node;
 
+	/* This happens if we quit before purple_set_blist is called. */
+	if (purplebuddylist == NULL)
+		return;
+
+	if (purplebuddylist->save_timer != 0) {
+		purple_timeout_remove(purplebuddylist->save_timer);
+		purplebuddylist->save_timer = 0;
+		purple_blist_sync();
+	}
+
+	node = purple_blist_get_root();
+	while (node) {
+		next_node = node->next;
+		purple_blist_node_destroy(node);
+		node = next_node;
+	}
+	purplebuddylist->root = NULL;
+	
+	g_hash_table_destroy(purplebuddylist->buddies);
+	g_hash_table_destroy(purplebuddylist->buddies_cache);
+
+	purple_signals_disconnect_by_handle(purple_blist_get_handle());
+	purple_signals_unregister_by_instance(purple_blist_get_handle());
+};
+
+/******************/
+/*  GObject Code  */
+/******************/
+
+static void
+purple_blist_finalize(GObject *object)
+{
+  PurpleBuddyList *purplebuddylist = PURPLE_BUDDY_LIST(object);
+	PurpleBlistUiOps *ops = purple_blist_get_ui_ops();
+
+	purple_debug(PURPLE_DEBUG_INFO, "blist", "Destroying\n");
+
+	if (ops && ops->destroy)
+		ops->destroy(purplebuddylist);
+  parent_class->finalize(object);
+}
+
+static void
+purple_blist_class_init(PurpleBuddyListClass *klass)
+{
+	GObjectClass *obj_class = G_OBJECT_CLASS(klass);
+  void *handle = purple_blist_get_handle();
+
+	parent_class = g_type_class_peek_parent(klass);
+	obj_class->finalize = purple_blist_finalize;
+
 	purple_signal_register(handle, "buddy-status-changed",
 	                     purple_marshal_VOID__POINTER_POINTER_POINTER, NULL,
 	                     3,
@@ -1201,64 +1246,7 @@ purple_blist_init(void)
 			NULL);
 }
 
-void
-purple_blist_uninit(void)
-{
-	PurpleBlistNode *node, *next_node;
-
-	/* This happens if we quit before purple_set_blist is called. */
-	if (purplebuddylist == NULL)
-		return;
-
-	if (purplebuddylist->save_timer != 0) {
-		purple_timeout_remove(purplebuddylist->save_timer);
-		purplebuddylist->save_timer = 0;
-		purple_blist_sync();
-	}
-
-	node = purple_blist_get_root();
-	while (node) {
-		next_node = node->next;
-		purple_blist_node_destroy(node);
-		node = next_node;
-	}
-	purplebuddylist->root = NULL;
-	
-	g_hash_table_destroy(purplebuddylist->buddies);
-	g_hash_table_destroy(purplebuddylist->buddies_cache);
-
-	purple_signals_disconnect_by_handle(purple_blist_get_handle());
-	purple_signals_unregister_by_instance(purple_blist_get_handle());
-};
-
-/******************/
-/*  GObject Code  */
-/******************/
-
 static void
-purple_blist_finalize(GObject *object)
-{
-  PurpleBuddyList *purplebuddylist = PURPLE_BUDDY_LIST(object);
-	PurpleBlistUiOps *ops = purple_blist_get_ui_ops();
-
-	purple_debug(PURPLE_DEBUG_INFO, "blist", "Destroying\n");
-
-	if (ops && ops->destroy)
-		ops->destroy(purplebuddylist);
-  parent_class->finalize(object);
-}
-
-static void
-purple_blist_class_init(PurpleBuddyListClass *klass)
-{
-	GObjectClass *obj_class = G_OBJECT_CLASS(klass);
-
-	parent_class = g_type_class_peek_parent(klass);
-	obj_class->finalize = purple_blist_finalize;
-
-}
-
-static void
 purple_blist_instance_init(GTypeInstance *instance, gpointer class)
 {
 
============================================================
--- libpurple/core.c	c0a9d5c6881a5d439d55b189340590d1004ef6a3
+++ libpurple/core.c	edc7cf35019bb3ebb8925f0b76a75aa160aa74e0
@@ -161,7 +161,6 @@ purple_core_init(const char *ui)
 	purple_notify_init();
 	purple_certificate_init();
 	purple_conversations_init();
-	purple_blist_init();
 	purple_log_init();
 	purple_network_init();
 	purple_privacy_init();


More information about the Commits mailing list