gobjectification: a2135516: more puttering with connection and accou...

ecoffey at soc.pidgin.im ecoffey at soc.pidgin.im
Sat Jun 21 02:30:38 EDT 2008


-----------------------------------------------------------------
Revision: a21355161b8f75ed4f204fe3e5981cc68154d60a
Ancestor: f4bf48c7c2f45c8dd96a973162e174e90f3f53c0
Author: ecoffey at soc.pidgin.im
Date: 2008-06-21T06:24:42
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/a21355161b8f75ed4f204fe3e5981cc68154d60a

Modified files:
        libpurple/account.c libpurple/account.h
        libpurple/connection.c

ChangeLog: 

more puttering with connection and account

-------------- next part --------------
============================================================
--- libpurple/account.c	6d1194c78054f7b5b4980b4e25361b5542620ce1
+++ libpurple/account.c	7ed035f030c6dd9798efae88a2d5cba4265d6952
@@ -497,12 +497,16 @@ static void purple_account_class_init(Pu
 #warning TODO: create signals and properties
 }
 
-static void purple_account_init(PurpleAccount *account)
+static void purple_account_init(GTypeInstance *instance, gpointer klass)
 {
 #warning TODO: Move the initializations from _account_new to here
+
+	PurpleAccount *account = PURPLE_ACCOUNT(instance);
+
+	account->priv = g_new0(PurpleAccountPrivate, 1);
 }
 
-static GType purple_account_get_gtype(void)
+GType purple_account_get_gtype(void)
 {
 	static GType type = 0;
 
@@ -520,7 +524,7 @@ static GType purple_account_get_gtype(vo
 			NULL,
 		};
 
-		type = g_type_register_static(G_TYPE_OBJECT,
+		type = g_type_register_static(PURPLE_TYPE_OBJECT,
 				"PurpleAccount",
 				&info, 0);
 	}
============================================================
--- libpurple/account.h	7c43355d5a370d2497ac96423b99c7099ecf2068
+++ libpurple/account.h	19ef4224681f13420a14d52e7e1405aa0449cca5
@@ -27,8 +27,7 @@
 #ifndef _PURPLE_ACCOUNT_H_
 #define _PURPLE_ACCOUNT_H_
 
-#include <glib.h>
-#include <glib-object.h>
+#include "pobject.h"
 
 #define PURPLE_TYPE_ACCOUNT				(purple_account_get_gtype())
 #define PURPLE_ACCOUNT(obj)				(G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_ACCOUNT, PurpleAccount))
@@ -37,6 +36,8 @@
 #define PURPLE_IS_ACCOUNT_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_ACCOUNT))
 #define PURPLE_ACCOUNT_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_ACCOUNT, PurpleAccountClass))
 
+GType purple_account_get_gtype(void);
+
 typedef struct _PurpleAccount			PurpleAccount;
 typedef struct _PurpleAccountPrivate		PurpleAccountPrivate;
 typedef struct _PurpleAccountClass		PurpleAccountClass;
@@ -120,6 +121,10 @@ struct _PurpleAccount
  */
 struct _PurpleAccount
 {
+	PurpleObject parent;
+
+	PurpleAccountPrivate *priv;	
+
 	char *username;             /**< The username.                          */
 	char *alias;                /**< How you appear to yourself.            */
 	char *password;             /**< The account password.                  */
@@ -153,8 +158,6 @@ struct _PurpleAccount
 	void *ui_data;              /**< The UI can put data here.              */
 	PurpleAccountRegistrationCb registration_cb;
 	void *registration_cb_user_data;
-
-	gpointer priv;              /**< Pointer to opaque private data. */
 };
 
 struct _PurpleAccountClass
============================================================
--- libpurple/connection.c	2dbc99dfc8b491c4eae0573da28d059590f79edd
+++ libpurple/connection.c	50102fd43192538110dcbd902d7bdd6886c07cf8
@@ -844,6 +844,13 @@ purple_connection_class_init(PurpleConne
 	obj_class->set_property = purple_connection_set_property;
 	obj_class->finalize = purple_connection_finalize;
 
+	/* explicitly make these pure */
+	klass->signing_on = NULL;
+	klass->signed_on = NULL;
+
+	klass->signing_off = NULL;
+	klass->signed_off = NULL;
+
 	pspec = g_param_spec_flags("flags", "flags",
 							  "The flags for this connection.",
 							  PURPLE_TYPE_CONNECTION_FLAGS,


More information about the Commits mailing list