/soc/2013/ankitkv/gobjectification: d6e55ebf2820: Merged soc.201...
Ankit Vani
a at nevitus.org
Tue Oct 1 08:11:57 EDT 2013
Changeset: d6e55ebf282063cc47feb1ac11f35e97a3459be2
Author: Ankit Vani <a at nevitus.org>
Date: 2013-10-01 17:35 +0530
Branch: soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/d6e55ebf2820
Description:
Merged soc.2013.gobjectification branch
diffstat:
libpurple/account.c | 37 +++++++++-------
libpurple/blistnodetypes.c | 72 ++++++++++++--------------------
libpurple/buddylist.c | 12 +----
libpurple/connection.c | 18 +------
libpurple/conversation.c | 35 +++------------
libpurple/conversationtypes.c | 95 +++++++++++++++++++++++-------------------
libpurple/presence.c | 12 +++-
libpurple/roomlist.c | 20 ++------
libpurple/status.c | 14 +----
libpurple/whiteboard.c | 14 +-----
libpurple/xfer.c | 45 ++++++++------------
11 files changed, 149 insertions(+), 225 deletions(-)
diffs (truncated from 796 to 300 lines):
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -2907,6 +2907,24 @@ purple_account_constructed(GObject *obje
static void
purple_account_dispose(GObject *object)
{
+ PurpleAccount *account = PURPLE_ACCOUNT(object);
+ PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
+
+ if (!purple_account_is_disconnected(account))
+ purple_account_disconnect(account);
+
+ if (priv->presence) {
+ g_object_unref(priv->presence);
+ priv->presence = NULL;
+ }
+
+ parent_class->dispose(object);
+}
+
+/* GObject finalize function */
+static void
+purple_account_finalize(GObject *object)
+{
GList *l;
PurpleAccount *account = PURPLE_ACCOUNT(object);
PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
@@ -2928,30 +2946,15 @@ purple_account_dispose(GObject *object)
if (priv->proxy_info)
purple_proxy_info_destroy(priv->proxy_info);
- if (priv->presence)
- g_object_unref(priv->presence);
-
if(priv->system_log)
purple_log_free(priv->system_log);
+ PURPLE_DBUS_UNREGISTER_POINTER(priv->current_error);
if (priv->current_error) {
g_free(priv->current_error->description);
g_free(priv->current_error);
}
- PURPLE_DBUS_UNREGISTER_POINTER(priv->current_error);
- PURPLE_DBUS_UNREGISTER_POINTER(account);
-
- parent_class->dispose(object);
-}
-
-/* GObject finalize function */
-static void
-purple_account_finalize(GObject *object)
-{
- PurpleAccount *account = PURPLE_ACCOUNT(object);
- PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
-
g_free(priv->username);
g_free(priv->alias);
purple_str_wipe(priv->password);
@@ -2972,6 +2975,8 @@ purple_account_finalize(GObject *object)
priv->permit = g_slist_delete_link(priv->permit, priv->permit);
}
+ PURPLE_DBUS_UNREGISTER_POINTER(account);
+
parent_class->finalize(object);
}
diff --git a/libpurple/blistnodetypes.c b/libpurple/blistnodetypes.c
--- a/libpurple/blistnodetypes.c
+++ b/libpurple/blistnodetypes.c
@@ -623,6 +623,25 @@ purple_buddy_constructed(GObject *object
static void
purple_buddy_dispose(GObject *object)
{
+ PurpleBuddyPrivate *priv = PURPLE_BUDDY_GET_PRIVATE(object);
+
+ if (priv->icon) {
+ purple_buddy_icon_unref(priv->icon);
+ priv->icon = NULL;
+ }
+
+ if (priv->presence) {
+ g_object_unref(priv->presence);
+ priv->presence = NULL;
+ }
+
+ G_OBJECT_CLASS(blistnode_parent_class)->dispose(object);
+}
+
+/* GObject finalize function */
+static void
+purple_buddy_finalize(GObject *object)
+{
PurpleBuddy *buddy = PURPLE_BUDDY(object);
PurpleBuddyPrivate *priv = PURPLE_BUDDY_GET_PRIVATE(buddy);
PurpleProtocol *protocol;
@@ -635,25 +654,12 @@ purple_buddy_dispose(GObject *object)
if (protocol)
purple_protocol_client_iface_buddy_free(protocol, buddy);
- /* Delete the node */
- purple_buddy_icon_unref(priv->icon);
- g_object_unref(priv->presence);
-
- PURPLE_DBUS_UNREGISTER_POINTER(buddy);
-
- G_OBJECT_CLASS(blistnode_parent_class)->dispose(object);
-}
-
-/* GObject finalize function */
-static void
-purple_buddy_finalize(GObject *object)
-{
- PurpleBuddyPrivate *priv = PURPLE_BUDDY_GET_PRIVATE(object);
-
g_free(priv->name);
g_free(priv->local_alias);
g_free(priv->server_alias);
+ PURPLE_DBUS_UNREGISTER_POINTER(buddy);
+
G_OBJECT_CLASS(blistnode_parent_class)->finalize(object);
}
@@ -1013,21 +1019,14 @@ purple_contact_init(GTypeInstance *insta
PURPLE_DBUS_REGISTER_POINTER(contact, PurpleContact);
}
-/* GObject dispose function */
-static void
-purple_contact_dispose(GObject *object)
-{
- PURPLE_DBUS_UNREGISTER_POINTER(object);
-
- G_OBJECT_CLASS(counting_parent_class)->dispose(object);
-}
-
/* GObject finalize function */
static void
purple_contact_finalize(GObject *object)
{
g_free(PURPLE_CONTACT_GET_PRIVATE(object)->alias);
+ PURPLE_DBUS_UNREGISTER_POINTER(object);
+
G_OBJECT_CLASS(counting_parent_class)->finalize(object);
}
@@ -1038,7 +1037,6 @@ static void purple_contact_class_init(Pu
counting_parent_class = g_type_class_peek_parent(klass);
- obj_class->dispose = purple_contact_dispose;
obj_class->finalize = purple_contact_finalize;
/* Setup properties */
@@ -1275,15 +1273,6 @@ purple_chat_constructed(GObject *object)
ops->new_node(PURPLE_BLIST_NODE(chat));
}
-/* GObject dispose function */
-static void
-purple_chat_dispose(GObject *object)
-{
- PURPLE_DBUS_UNREGISTER_POINTER(object);
-
- G_OBJECT_CLASS(blistnode_parent_class)->dispose(object);
-}
-
/* GObject finalize function */
static void
purple_chat_finalize(GObject *object)
@@ -1293,6 +1282,8 @@ purple_chat_finalize(GObject *object)
g_free(priv->alias);
g_hash_table_destroy(priv->components);
+ PURPLE_DBUS_UNREGISTER_POINTER(object);
+
G_OBJECT_CLASS(blistnode_parent_class)->finalize(object);
}
@@ -1303,7 +1294,6 @@ static void purple_chat_class_init(Purpl
blistnode_parent_class = g_type_class_peek_parent(klass);
- obj_class->dispose = purple_chat_dispose;
obj_class->finalize = purple_chat_finalize;
/* Setup properties */
@@ -1624,21 +1614,14 @@ purple_group_constructed(GObject *object
ops->new_node(PURPLE_BLIST_NODE(group));
}
-/* GObject dispose function */
-static void
-purple_group_dispose(GObject *object)
-{
- PURPLE_DBUS_UNREGISTER_POINTER(object);
-
- G_OBJECT_CLASS(counting_parent_class)->dispose(object);
-}
-
/* GObject finalize function */
static void
purple_group_finalize(GObject *object)
{
g_free(PURPLE_GROUP_GET_PRIVATE(object)->name);
+ PURPLE_DBUS_UNREGISTER_POINTER(object);
+
G_OBJECT_CLASS(counting_parent_class)->finalize(object);
}
@@ -1649,7 +1632,6 @@ static void purple_group_class_init(Purp
counting_parent_class = g_type_class_peek_parent(klass);
- obj_class->dispose = purple_group_dispose;
obj_class->finalize = purple_group_finalize;
obj_class->constructed = purple_group_constructed;
diff --git a/libpurple/buddylist.c b/libpurple/buddylist.c
--- a/libpurple/buddylist.c
+++ b/libpurple/buddylist.c
@@ -2046,21 +2046,14 @@ purple_buddy_list_init(GTypeInstance *in
(GDestroyNotify)_purple_blist_hbuddy_free_key, NULL);
}
-/* GObject dispose function */
-static void
-purple_buddy_list_dispose(GObject *object)
-{
- PURPLE_DBUS_UNREGISTER_POINTER(object);
-
- G_OBJECT_CLASS(parent_class)->dispose(object);
-}
-
/* GObject finalize function */
static void
purple_buddy_list_finalize(GObject *object)
{
g_hash_table_destroy(PURPLE_BUDDY_LIST_GET_PRIVATE(object)->buddies);
+ PURPLE_DBUS_UNREGISTER_POINTER(object);
+
G_OBJECT_CLASS(parent_class)->finalize(object);
}
@@ -2071,7 +2064,6 @@ static void purple_buddy_list_class_init
parent_class = g_type_class_peek_parent(klass);
- obj_class->dispose = purple_buddy_list_dispose;
obj_class->finalize = purple_buddy_list_finalize;
g_type_class_add_private(klass, sizeof(PurpleBuddyListPrivate));
diff --git a/libpurple/connection.c b/libpurple/connection.c
--- a/libpurple/connection.c
+++ b/libpurple/connection.c
@@ -689,9 +689,9 @@ purple_connection_constructed(GObject *o
purple_signal_emit(purple_connections_get_handle(), "signing-on", gc);
}
-/* GObject dispose function */
+/* GObject finalize function */
static void
-purple_connection_dispose(GObject *object)
+purple_connection_finalize(GObject *object)
{
PurpleConnection *gc = PURPLE_CONNECTION(object);
PurpleConnectionPrivate *priv = PURPLE_CONNECTION_GET_PRIVATE(gc);
@@ -751,20 +751,11 @@ purple_connection_dispose(GObject *objec
if (priv->disconnect_timeout > 0)
purple_timeout_remove(priv->disconnect_timeout);
- PURPLE_DBUS_UNREGISTER_POINTER(gc);
-
- G_OBJECT_CLASS(parent_class)->dispose(object);
-}
-
-/* GObject finalize function */
-static void
-purple_connection_finalize(GObject *object)
-{
- PurpleConnectionPrivate *priv = PURPLE_CONNECTION_GET_PRIVATE(object);
-
purple_str_wipe(priv->password);
g_free(priv->display_name);
+ PURPLE_DBUS_UNREGISTER_POINTER(gc);
+
G_OBJECT_CLASS(parent_class)->finalize(object);
}
@@ -775,7 +766,6 @@ static void purple_connection_class_init
parent_class = g_type_class_peek_parent(klass);
More information about the Commits
mailing list