gobjectification: 92c3c6ee: We are eventually going to need PurpleOb...

sadrul at pidgin.im sadrul at pidgin.im
Thu Mar 13 04:48:31 EDT 2008


-----------------------------------------------------------------
Revision: 92c3c6eeeeee13fa192ddf945cd091de6595aaa9
Ancestor: f94a547aac997934956f096d09694105e3ce6d67
Author: sadrul at pidgin.im
Date: 2008-03-13T08:48:02
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/92c3c6eeeeee13fa192ddf945cd091de6595aaa9

Modified files:
        libpurple/pobject.c libpurple/pobject.h

ChangeLog: 

We are eventually going to need PurpleObject:ui_data. Add this now.

-------------- next part --------------
============================================================
--- libpurple/pobject.c	38f9534b220213c93a903aa3854fc49b70c8dc5b
+++ libpurple/pobject.c	b59936961f6309c69a306a519247081b0f4f1977
@@ -23,6 +23,7 @@ struct _PurpleObjectPrivate
 struct _PurpleObjectPrivate
 {
 	gpointer proto_data;
+	gpointer ui_data;
 };
 
 static GObjectClass *parent_class;
@@ -36,6 +37,10 @@ purple_object_dispose(GObject *obj)
 		g_warning("Purple-Object: object destroyed without unsetting the protocol data. This may lead to memory leak.\n");
 	}
 
+	if (pobj->priv->ui_data) {
+		g_warning("Purple-Object: object destroyed without unsetting the ui data. This may lead to memory leak.\n");
+	}
+
 	/* XXX: do _notify_close_with_handle etc here */
 
 	parent_class->dispose(obj);
@@ -98,6 +103,18 @@ gpointer purple_object_get_protocol_data
 	return pobj->priv->proto_data;
 }
 
+void purple_object_set_ui_data(PurpleObject *pobj, gpointer ui_data)
+{
+	g_return_if_fail(pobj);
+	pobj->priv->ui_data = ui_data;
+}
+
+gpointer purple_object_get_ui_data(PurpleObject *pobj)
+{
+	g_return_val_if_fail(pobj, NULL);
+	return pobj->priv->ui_data;
+}
+
 int purple_object_get_int(PurpleObject *pobj, const char *prop)
 {
 	int ret;
============================================================
--- libpurple/pobject.h	82eb612d2da80440b8d99c8697aa98e5e4b513a0
+++ libpurple/pobject.h	18fe9cec069e515633b56a33dea53ecdc2b83f88
@@ -57,6 +57,10 @@ gpointer purple_object_get_protocol_data
 
 gpointer purple_object_get_protocol_data(PurpleObject *pobj);
 
+void purple_object_set_ui_data(PurpleObject *pobj, gpointer ui_data);
+
+gpointer purple_object_get_ui_data(PurpleObject *pobj);
+
 int purple_object_get_int(PurpleObject *pobj, const char *prop);
 
 G_END_DECLS


More information about the Commits mailing list