/soc/2013/ankitkv/gobjectification: cf9e572853b2: Assign convers...
Ankit Vani
a at nevitus.org
Fri Jun 28 15:15:31 EDT 2013
Changeset: cf9e572853b2ea4320b7817f877d4be9a2991453
Author: Ankit Vani <a at nevitus.org>
Date: 2013-06-29 00:45 +0530
Branch: soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/cf9e572853b2
Description:
Assign conversation initialization properties directly
diffstat:
libpurple/conversation.c | 12 ++++++++----
libpurple/conversationtypes.c | 6 ------
2 files changed, 8 insertions(+), 10 deletions(-)
diffs (52 lines):
diff --git a/libpurple/conversation.c b/libpurple/conversation.c
--- a/libpurple/conversation.c
+++ b/libpurple/conversation.c
@@ -896,17 +896,21 @@ purple_conversation_set_property(GObject
GParamSpec *pspec)
{
PurpleConversation *conv = PURPLE_CONVERSATION(obj);
+ PurpleConversationPrivate *priv = PURPLE_CONVERSATION_GET_PRIVATE(conv);
switch (param_id) {
- /* TODO if creation of conversation doesn't work, assign directly */
+ /* account, name and title are assigned directly here as
+ * purple_im_conversation_new() and purple_chat_conversation_new()
+ * pass these properties as parameters, and so the conversation hasn't
+ * finished being set up */
case PROP_ACCOUNT:
- purple_conversation_set_account(conv, g_value_get_object(value));
+ priv->account = g_value_get_object(value);
break;
case PROP_NAME:
- purple_conversation_set_name(conv, g_value_get_string(value));
+ priv->name = g_strdup(g_value_get_string(value));
break;
case PROP_TITLE:
- purple_conversation_set_title(conv, g_value_get_string(value));
+ priv->title = g_strdup(g_value_get_string(value));
break;
case PROP_LOGGING:
purple_conversation_set_logging(conv, g_value_get_boolean(value));
diff --git a/libpurple/conversationtypes.c b/libpurple/conversationtypes.c
--- a/libpurple/conversationtypes.c
+++ b/libpurple/conversationtypes.c
@@ -565,9 +565,6 @@ purple_im_conversation_new(PurpleAccount
gc = purple_account_get_connection(account);
g_return_val_if_fail(gc != NULL, NULL);
- /* TODO check here. conversation-updated signals are emitted before
- * conversation-created signals because of the _set()'s
- */
im = g_object_new(PURPLE_TYPE_IM_CONVERSATION,
"account", account,
"name", name,
@@ -1630,9 +1627,6 @@ purple_chat_conversation_new(PurpleAccou
gc = purple_account_get_connection(account);
g_return_val_if_fail(gc != NULL, NULL);
- /* TODO check here. conversation-updated signals are emitted before
- * conversation-created signals because of the _set()'s
- */
chat = g_object_new(PURPLE_TYPE_CHAT_CONVERSATION,
"account", account,
"name", name,
More information about the Commits
mailing list