soc.2010.detachablepurple: f8011786: Added yet another PurpleObject property:...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Wed Jul 7 01:41:32 EDT 2010


----------------------------------------------------------------------
Revision: f8011786acd7a3034965089ddd11c8416e0ed6c8
Parent:   086707bc9ebd6a9c565a51174c85c7f7b43a7130
Author:   gillux at soc.pidgin.im
Date:     07/07/10 01:25:02
Branch:   im.pidgin.soc.2010.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/f8011786acd7a3034965089ddd11c8416e0ed6c8

Changelog: 

Added yet another PurpleObject property: dbus_purple_interface. We will need to have
the dbus interface name available directly, in order to generically and remotely
get/set a gobject property.

Changes against parent 086707bc9ebd6a9c565a51174c85c7f7b43a7130

  patched  libpurple/pobject.c
  patched  libpurple/pobject.h

-------------- next part --------------
============================================================
--- libpurple/pobject.c	eba4b66a79feefc0b7747adb4f5e3f84cc227f43
+++ libpurple/pobject.c	1253733d5c815b289b3a98b06d1bc043bd753eb8
@@ -24,10 +24,14 @@ struct _PurpleObjectPrivate
 {
 	gpointer proto_data;
 	gpointer ui_data;
+	/* The dbus interface we use for purple related methods and signals,
+	 * e.g. im.pidgin.purple.account.
+	 */
+	char* dbus_purple_interface;
 	/* This is actually a DBusGProxy*, but we hold it as a pointer
 	 * to avoid to have to include dbus just *everywhere* beceause
 	 * of this definition. This proxy is for the related object interface,
-	 * e.g. im.pidgin.purple.account.
+	 * which is set in the dbus_purple_interface field.
 	 */
 	gpointer dbus_obj_proxy;
 	/* This is a DBusGProxy* too, but this time for the dbus properties
@@ -59,6 +63,8 @@ purple_object_dispose(GObject *obj)
 		g_warning("Purple-Object: object destroyed without unsetting the ui data. This may lead to memory leak.\n");
 	}
 
+	g_free(pobj->priv->dbus_purple_interface);
+
 	if(pobj->priv->dbus_obj_proxy)
 		g_object_unref(pobj->priv->dbus_obj_proxy);
 
@@ -98,6 +104,7 @@ purple_object_init(GTypeInstance *instan
 	PurpleObject *pobj = PURPLE_OBJECT(instance);
 	pobj->priv = G_TYPE_INSTANCE_GET_PRIVATE(pobj, PURPLE_TYPE_OBJECT, PurpleObjectPrivate);
 	pobj->priv->proto_data = NULL;
+	pobj->priv->dbus_purple_interface = NULL;
 	pobj->priv->dbus_obj_proxy = NULL;
 	pobj->priv->dbus_props_proxy = NULL;
 	pobj->priv->dbus_path = NULL;
@@ -153,6 +160,20 @@ gpointer purple_object_get_ui_data(Purpl
 	return pobj->priv->ui_data;
 }
 
+char*
+purple_object_get_dbus_obj_interface(PurpleObject *pobj)
+{
+	g_return_val_if_fail(pobj, NULL);
+	return pobj->priv->dbus_purple_interface;
+}
+
+void
+purple_object_set_dbus_obj_interface(PurpleObject *pobj, char* interface)
+{
+	g_return_if_fail(pobj);
+	pobj->priv->dbus_purple_interface = g_strdup(interface);
+}
+
 gpointer
 purple_object_get_dbus_obj_proxy(PurpleObject *pobj)
 {
============================================================
--- libpurple/pobject.h	50728c875bc2bb6a90d6b1de2b924fe149ca4848
+++ libpurple/pobject.h	ba31fb53d3706e453b6c83702e9fe578199d7025
@@ -80,6 +80,18 @@ gpointer purple_object_get_dbus_props_pr
 gpointer purple_object_get_dbus_props_proxy(PurpleObject *pobj);
 
 /**
+ * Gets the dbus interface name we use for purple related methods and signals,
+ * e.g. im.pidgin.purple.account.
+ */
+char* purple_object_get_dbus_obj_interface(PurpleObject *pobj);
+
+/**
+ * Sets the dbus interface name we use for purple related methods and signals,
+ * e.g. im.pidgin.purple.account.
+ */
+void purple_object_set_dbus_obj_interface(PurpleObject *pobj, char* interface);
+
+/**
  * Sets the dbus proxy. This is used in detachable sessions context only.
  *
  * We use a gpointer here but we mean a DBusDProxy. It is to avoid to include


More information about the Commits mailing list