/soc/2013/ankitkv/gobjectification: c0099fc27ace: Merged soc.201...

Ankit Vani a at nevitus.org
Fri Oct 11 07:25:54 EDT 2013


Changeset: c0099fc27ace8d81826950251765283ba4c67a78
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-10-11 15:54 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/c0099fc27ace

Description:

Merged soc.2013.gobjectification branch

diffstat:

 libpurple/ciphers/aescipher.c    |   8 +--
 libpurple/ciphers/des3cipher.c   |   6 --
 libpurple/ciphers/descipher.c    |   2 -
 libpurple/ciphers/hmaccipher.c   |   1 -
 libpurple/ciphers/pbkdf2cipher.c |   1 -
 libpurple/ciphers/rc4cipher.c    |   4 -
 libpurple/connection.c           |  39 +++++++--------
 libpurple/conversation.c         |  21 +++-----
 libpurple/conversation.h         |   1 +
 libpurple/conversationtypes.c    |  97 ++++++++++++++-------------------------
 libpurple/conversationtypes.h    |   8 ---
 libpurple/presence.c             |  33 ++++---------
 libpurple/roomlist.c             |  17 +++---
 libpurple/smiley.c               |  17 ++----
 libpurple/status.c               |  18 +++----
 libpurple/whiteboard.c           |  24 ++++-----
 libpurple/xfer.c                 |  74 +++++++++++++++---------------
 17 files changed, 146 insertions(+), 225 deletions(-)

diffs (truncated from 1255 to 300 lines):

diff --git a/libpurple/ciphers/aescipher.c b/libpurple/ciphers/aescipher.c
--- a/libpurple/ciphers/aescipher.c
+++ b/libpurple/ciphers/aescipher.c
@@ -105,8 +105,6 @@ purple_aes_cipher_set_iv(PurpleCipher *c
 		memset(priv->iv, 0, sizeof(priv->iv));
 	else
 		memcpy(priv->iv, iv, len);
-
-	g_object_notify(G_OBJECT(cipher), "iv");
 }
 
 static void
@@ -125,8 +123,6 @@ purple_aes_cipher_set_key(PurpleCipher *
 	memset(priv->key, 0, sizeof(priv->key));
 	if (len > 0)
 		memcpy(priv->key, key, len);
-
-	g_object_notify(G_OBJECT(cipher), "key");
 }
 
 static guchar *
@@ -507,10 +503,8 @@ purple_aes_cipher_set_batch_mode(PurpleC
 {
 	PurpleAESCipherPrivate *priv = PURPLE_AES_CIPHER_GET_PRIVATE(cipher);
 
-	if (mode == PURPLE_CIPHER_BATCH_MODE_CBC) {
-		g_object_notify(G_OBJECT(cipher), "batch_mode");
+	if (mode == PURPLE_CIPHER_BATCH_MODE_CBC)
 		return;
-	}
 
 	purple_debug_error("cipher-aes", "unsupported batch mode\n");
 	priv->failure = TRUE;
diff --git a/libpurple/ciphers/des3cipher.c b/libpurple/ciphers/des3cipher.c
--- a/libpurple/ciphers/des3cipher.c
+++ b/libpurple/ciphers/des3cipher.c
@@ -100,8 +100,6 @@ purple_des3_cipher_set_key(PurpleCipher 
 					purple_cipher_get_key_size(PURPLE_CIPHER(priv->key2)));
 	purple_cipher_set_key(PURPLE_CIPHER(priv->key3), key + 16,
 					purple_cipher_get_key_size(PURPLE_CIPHER(priv->key3)));
-
-	g_object_notify(G_OBJECT(des3_cipher), "key");
 }
 
 static ssize_t
@@ -353,8 +351,6 @@ purple_des3_cipher_set_batch_mode(Purple
 	PurpleDES3CipherPrivate *priv = PURPLE_DES3_CIPHER_GET_PRIVATE(des3_cipher);
 
 	priv->mode = mode;
-
-	g_object_notify(G_OBJECT(des3_cipher), "batch_mode");
 }
 
 static PurpleCipherBatchMode
@@ -375,8 +371,6 @@ purple_des3_cipher_set_iv(PurpleCipher *
 	g_return_if_fail(len == 8);
 
 	memcpy(priv->iv, iv, len);
-
-	g_object_notify(G_OBJECT(des3_cipher), "iv");
 }
 
 /******************************************************************************
diff --git a/libpurple/ciphers/descipher.c b/libpurple/ciphers/descipher.c
--- a/libpurple/ciphers/descipher.c
+++ b/libpurple/ciphers/descipher.c
@@ -382,8 +382,6 @@ purple_des_cipher_set_key(PurpleCipher *
 		priv->decrypt_subkeys[i] = priv->encrypt_subkeys[30 - i];
 		priv->decrypt_subkeys[i + 1] = priv->encrypt_subkeys[31 - i];
 	}
-
-	g_object_notify(G_OBJECT(cipher), "key");
 }
 
 static size_t
diff --git a/libpurple/ciphers/hmaccipher.c b/libpurple/ciphers/hmaccipher.c
--- a/libpurple/ciphers/hmaccipher.c
+++ b/libpurple/ciphers/hmaccipher.c
@@ -59,7 +59,6 @@ purple_hmac_cipher_set_hash(PurpleCipher
 	PurpleHMACCipherPrivate *priv = PURPLE_HMAC_CIPHER_GET_PRIVATE(cipher);
 
 	priv->hash = g_object_ref(G_OBJECT(hash));
-	g_object_notify(G_OBJECT(cipher), "hash");
 }
 
 /*******************************************************************************
diff --git a/libpurple/ciphers/pbkdf2cipher.c b/libpurple/ciphers/pbkdf2cipher.c
--- a/libpurple/ciphers/pbkdf2cipher.c
+++ b/libpurple/ciphers/pbkdf2cipher.c
@@ -72,7 +72,6 @@ purple_pbkdf2_cipher_set_hash(PurpleCiph
 	PurplePBKDF2CipherPrivate *priv = PURPLE_PBKDF2_CIPHER_GET_PRIVATE(cipher);
 
 	priv->hash = g_object_ref(G_OBJECT(hash));
-	g_object_notify(G_OBJECT(cipher), "hash");
 }
 
 /******************************************************************************
diff --git a/libpurple/ciphers/rc4cipher.c b/libpurple/ciphers/rc4cipher.c
--- a/libpurple/ciphers/rc4cipher.c
+++ b/libpurple/ciphers/rc4cipher.c
@@ -88,8 +88,6 @@ purple_rc4_cipher_set_key(PurpleCipher *
 		state[y] = temp_swap;
 		x = (x + 1) % len;
 	}
-
-	g_object_notify(G_OBJECT(rc4_cipher), "key");
 }
 
 static ssize_t
@@ -242,8 +240,6 @@ purple_rc4_cipher_set_key_len(PurpleRC4C
 
 	priv = PURPLE_RC4_CIPHER_GET_PRIVATE(rc4_cipher);
 	priv->key_len = key_len;
-
-	g_object_notify(G_OBJECT(rc4_cipher), "key_len");
 }
 
 gint
diff --git a/libpurple/connection.c b/libpurple/connection.c
--- a/libpurple/connection.c
+++ b/libpurple/connection.c
@@ -241,6 +241,8 @@ purple_connection_set_state(PurpleConnec
 		if (ops != NULL && ops->disconnected != NULL)
 			ops->disconnected(gc);
 	}
+
+	g_object_notify(G_OBJECT(gc), "state");
 }
 
 void
@@ -251,6 +253,8 @@ purple_connection_set_flags(PurpleConnec
 	g_return_if_fail(priv != NULL);
 
 	priv->flags = flags;
+
+	g_object_notify(G_OBJECT(gc), "flags");
 }
 
 void
@@ -262,6 +266,8 @@ purple_connection_set_display_name(Purpl
 
 	g_free(priv->display_name);
 	priv->display_name = g_strdup(name);
+
+	g_object_notify(G_OBJECT(gc), "display-name");
 }
 
 void
@@ -587,13 +593,6 @@ purple_connection_error_info_get_type(vo
 /**************************************************************************
  * GObject code
  **************************************************************************/
-/* GObject Property names */
-#define PROP_PROTOCOL_S      "protocol"
-#define PROP_FLAGS_S         "flags"
-#define PROP_STATE_S         "state"
-#define PROP_ACCOUNT_S       "account"
-#define PROP_PASSWORD_S      "password"
-#define PROP_DISPLAY_NAME_S  "display-name"
 
 /* Set method for GObject properties */
 static void
@@ -682,7 +681,7 @@ purple_connection_constructed(GObject *o
 
 	G_OBJECT_CLASS(parent_class)->constructed(object);
 
-	g_object_get(gc, PROP_ACCOUNT_S, &account, NULL);
+	g_object_get(gc, "account", &account, NULL);
 	purple_account_set_connection(account, gc);
 	g_object_unref(account);
 
@@ -774,40 +773,40 @@ static void purple_connection_class_init
 	obj_class->set_property = purple_connection_set_property;
 
 	g_object_class_install_property(obj_class, PROP_PROTOCOL,
-			g_param_spec_object(PROP_PROTOCOL_S, _("Protocol"),
+			g_param_spec_object("protocol", _("Protocol"),
 				_("The protocol that the connection is using."),
 				PURPLE_TYPE_PROTOCOL,
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)
 			);
 
 	g_object_class_install_property(obj_class, PROP_FLAGS,
-			g_param_spec_flags(PROP_FLAGS_S, _("Connection flags"),
+			g_param_spec_flags("flags", _("Connection flags"),
 				_("The flags of the connection."),
 				PURPLE_TYPE_CONNECTION_FLAGS, 0,
 				G_PARAM_READWRITE)
 			);
 
 	g_object_class_install_property(obj_class, PROP_STATE,
-			g_param_spec_enum(PROP_STATE_S, _("Connection state"),
+			g_param_spec_enum("state", _("Connection state"),
 				_("The current state of the connection."),
 				PURPLE_TYPE_CONNECTION_STATE, PURPLE_CONNECTION_DISCONNECTED,
 				G_PARAM_READWRITE)
 			);
 
 	g_object_class_install_property(obj_class, PROP_ACCOUNT,
-			g_param_spec_object(PROP_ACCOUNT_S, _("Account"),
+			g_param_spec_object("account", _("Account"),
 				_("The account using the connection."), PURPLE_TYPE_ACCOUNT,
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)
 			);
 
 	g_object_class_install_property(obj_class, PROP_PASSWORD,
-			g_param_spec_string(PROP_PASSWORD_S, _("Password"),
+			g_param_spec_string("password", _("Password"),
 				_("The password used for connection."), NULL,
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)
 			);
 
 	g_object_class_install_property(obj_class, PROP_DISPLAY_NAME,
-			g_param_spec_string(PROP_DISPLAY_NAME_S, _("Display name"),
+			g_param_spec_string("display-name", _("Display name"),
 				_("Your name that appears to other people."), NULL,
 				G_PARAM_READWRITE)
 			);
@@ -888,9 +887,9 @@ void
 				password);
 	else
 		gc = g_object_new(PURPLE_TYPE_CONNECTION,
-				PROP_PROTOCOL_S,  protocol,
-				PROP_ACCOUNT_S,   account,
-				PROP_PASSWORD_S,  password,
+				"protocol",  protocol,
+				"account",   account,
+				"password",  password,
 				NULL);
 
 	g_return_if_fail(gc != NULL);
@@ -955,9 +954,9 @@ void
 				password);
 	else
 		gc = g_object_new(PURPLE_TYPE_CONNECTION,
-				PROP_PROTOCOL_S,  protocol,
-				PROP_ACCOUNT_S,   account,
-				PROP_PASSWORD_S,  password,
+				"protocol",  protocol,
+				"account",   account,
+				"password",  password,
 				NULL);
 
 	g_return_if_fail(gc != NULL);
diff --git a/libpurple/conversation.c b/libpurple/conversation.c
--- a/libpurple/conversation.c
+++ b/libpurple/conversation.c
@@ -425,6 +425,8 @@ purple_conversation_set_name(PurpleConve
 	priv->name = g_strdup(name);
 
 	purple_conversation_autoset_title(conv);
+
+	purple_conversation_update(conv, PURPLE_CONVERSATION_UPDATE_NAME);
 }
 
 const char *
@@ -908,13 +910,6 @@ purple_conversation_get_max_message_size
  * GObject code
  **************************************************************************/
 
-/* GObject Property names */
-#define PROP_ACCOUNT_S   "account"
-#define PROP_NAME_S      "name"
-#define PROP_TITLE_S     "title"
-#define PROP_LOGGING_S   "logging"
-#define PROP_FEATURES_S  "features"
-
 /* Set method for GObject properties */
 static void
 purple_conversation_set_property(GObject *obj, guint param_id, const GValue *value,
@@ -987,7 +982,7 @@ purple_conversation_constructed(GObject 
 
 	parent_class->constructed(object);
 
-	g_object_get(object, PROP_ACCOUNT_S, &account, NULL);
+	g_object_get(object, "account", &account, NULL);
 	gc = purple_account_get_connection(account);
 
 	/* copy features from the connection. */
@@ -1061,31 +1056,31 @@ purple_conversation_class_init(PurpleCon
 	obj_class->set_property = purple_conversation_set_property;
 
 	g_object_class_install_property(obj_class, PROP_ACCOUNT,
-			g_param_spec_object(PROP_ACCOUNT_S, _("Account"),
+			g_param_spec_object("account", _("Account"),
 				_("The account for the conversation."), PURPLE_TYPE_ACCOUNT,
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT)
 			);
 
 	g_object_class_install_property(obj_class, PROP_NAME,
-			g_param_spec_string(PROP_NAME_S, _("Name"),
+			g_param_spec_string("name", _("Name"),
 				_("The name of the conversation."), NULL,
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT)
 			);
 
 	g_object_class_install_property(obj_class, PROP_TITLE,
-			g_param_spec_string(PROP_TITLE_S, _("Title"),
+			g_param_spec_string("title", _("Title"),
 				_("The title of the conversation."), NULL,



More information about the Commits mailing list