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

Ankit Vani a at nevitus.org
Sat Nov 16 17:54:33 EST 2013


Changeset: a464e58fe646ec0a73d577de56ff05077cb0976a
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-11-17 04:24 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/a464e58fe646

Description:

Merged soc.2013.gobjectification branch

diffstat:

 libpurple/ciphers/aescipher.c    |  17 +++++++++--------
 libpurple/ciphers/des3cipher.c   |  10 ++++++----
 libpurple/ciphers/descipher.c    |   2 +-
 libpurple/ciphers/hmaccipher.c   |   3 ++-
 libpurple/ciphers/pbkdf2cipher.c |  13 ++++++++-----
 libpurple/ciphers/rc4cipher.c    |   8 +++++---
 libpurple/media.c                |  16 ++++++++++------
 libpurple/media/backend-iface.c  |   6 ++++--
 libpurple/media/candidate.c      |  24 ++++++++++++------------
 libpurple/media/codec.c          |  19 +++++++++++++------
 libpurple/mediamanager.c         |  12 ++++++++----
 11 files changed, 78 insertions(+), 52 deletions(-)

diffs (truncated from 449 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
@@ -505,11 +505,12 @@ purple_aes_cipher_set_batch_mode(PurpleC
 {
 	PurpleAESCipherPrivate *priv = PURPLE_AES_CIPHER_GET_PRIVATE(cipher);
 
-	if (mode == PURPLE_CIPHER_BATCH_MODE_CBC)
-		return;
+	if (mode != PURPLE_CIPHER_BATCH_MODE_CBC) {
+		purple_debug_error("cipher-aes", "unsupported batch mode\n");
+		priv->failure = TRUE;
+	}
 
-	purple_debug_error("cipher-aes", "unsupported batch mode\n");
-	priv->failure = TRUE;
+	g_object_notify(G_OBJECT(cipher), "batch-mode");
 }
 
 static PurpleCipherBatchMode
@@ -590,17 +591,17 @@ purple_aes_cipher_class_init(PurpleAESCi
 	cipher_class->get_batch_mode = purple_aes_cipher_get_batch_mode;
 	cipher_class->get_block_size = purple_aes_cipher_get_block_size;
 
-	pspec = g_param_spec_enum("batch_mode", "batch_mode", "batch_mode",
+	pspec = g_param_spec_enum("batch-mode", "batch-mode", "batch-mode",
 							  PURPLE_TYPE_CIPHER_BATCH_MODE, 0,
-							  G_PARAM_READWRITE);
+							  G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_BATCH_MODE, pspec);
 
 	pspec = g_param_spec_string("iv", "iv", "iv", NULL,
-								G_PARAM_WRITABLE);
+								G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_IV, pspec);
 
 	pspec = g_param_spec_string("key", "key", "key", NULL,
-								G_PARAM_WRITABLE);
+								G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_KEY, pspec);
 
 	g_type_class_add_private(klass, sizeof(PurpleAESCipherPrivate));
diff --git a/libpurple/ciphers/des3cipher.c b/libpurple/ciphers/des3cipher.c
--- a/libpurple/ciphers/des3cipher.c
+++ b/libpurple/ciphers/des3cipher.c
@@ -352,6 +352,8 @@ purple_des3_cipher_set_batch_mode(Purple
 	PurpleDES3CipherPrivate *priv = PURPLE_DES3_CIPHER_GET_PRIVATE(des3_cipher);
 
 	priv->mode = mode;
+
+	g_object_notify(G_OBJECT(cipher), "batch-mode");
 }
 
 static PurpleCipherBatchMode
@@ -456,17 +458,17 @@ purple_des3_cipher_class_init(PurpleDES3
 	cipher_class->get_batch_mode = purple_des3_cipher_get_batch_mode;
 	cipher_class->get_key_size = purple_des3_cipher_get_key_size;
 
-	pspec = g_param_spec_enum("batch_mode", "batch_mode", "batch_mode",
+	pspec = g_param_spec_enum("batch-mode", "batch-mode", "batch-mode",
 							  PURPLE_TYPE_CIPHER_BATCH_MODE, 0,
-							  G_PARAM_READWRITE);
+							  G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_BATCH_MODE, pspec);
 
 	pspec = g_param_spec_string("iv", "iv", "iv", NULL,
-								G_PARAM_WRITABLE);
+								G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_IV, pspec);
 
 	pspec = g_param_spec_string("key", "key", "key", NULL,
-								G_PARAM_WRITABLE);
+								G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_KEY, pspec);
 
 	g_type_class_add_private(klass, sizeof(PurpleDES3CipherPrivate));
diff --git a/libpurple/ciphers/descipher.c b/libpurple/ciphers/descipher.c
--- a/libpurple/ciphers/descipher.c
+++ b/libpurple/ciphers/descipher.c
@@ -534,7 +534,7 @@ purple_des_cipher_class_init(PurpleDESCi
 	cipher_class->get_key_size = purple_des_cipher_get_key_size;
 
 	pspec = g_param_spec_string("key", "key", "key", NULL,
-								G_PARAM_WRITABLE);
+								G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_KEY, pspec);
 
 	g_type_class_add_private(klass, sizeof(PurpleDESCipherPrivate));
diff --git a/libpurple/ciphers/hmaccipher.c b/libpurple/ciphers/hmaccipher.c
--- a/libpurple/ciphers/hmaccipher.c
+++ b/libpurple/ciphers/hmaccipher.c
@@ -280,7 +280,8 @@ purple_hmac_cipher_class_init(PurpleHMAC
 	cipher_class->get_block_size = purple_hmac_cipher_get_block_size;
 
 	pspec = g_param_spec_object("hash", "hash", "hash", PURPLE_TYPE_HASH,
-								G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
+								G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
+								G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_HASH, pspec);
 }
 
diff --git a/libpurple/ciphers/pbkdf2cipher.c b/libpurple/ciphers/pbkdf2cipher.c
--- a/libpurple/ciphers/pbkdf2cipher.c
+++ b/libpurple/ciphers/pbkdf2cipher.c
@@ -337,15 +337,18 @@ purple_pbkdf2_cipher_class_init(PurplePB
 	cipher_class->set_key = purple_pbkdf2_cipher_set_key;
 
 	pspec = g_param_spec_object("hash", "hash", "hash", PURPLE_TYPE_HASH,
-								G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
+								G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
+								G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_HASH, pspec);
 
-	pspec = g_param_spec_uint("iter_count", "iter_count", "iter_count", 0,
-								G_MAXUINT, 0, G_PARAM_READWRITE);
+	pspec = g_param_spec_uint("iter-count", "iter-count", "iter-count", 0,
+								G_MAXUINT, 0, G_PARAM_READWRITE |
+								G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_ITER_COUNT, pspec);
 
-	pspec = g_param_spec_uint("out_len", "out_len", "out_len", 0,
-								G_MAXUINT, 0, G_PARAM_READWRITE);
+	pspec = g_param_spec_uint("out-len", "out-len", "out-len", 0,
+								G_MAXUINT, 0, G_PARAM_READWRITE |
+								G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_OUT_LEN, pspec);
 
 	g_type_class_add_private(klass, sizeof(PurplePBKDF2CipherPrivate));
diff --git a/libpurple/ciphers/rc4cipher.c b/libpurple/ciphers/rc4cipher.c
--- a/libpurple/ciphers/rc4cipher.c
+++ b/libpurple/ciphers/rc4cipher.c
@@ -180,13 +180,13 @@ purple_rc4_cipher_class_init(PurpleRC4Ci
 	cipher_class->encrypt = purple_rc4_cipher_encrypt;
 	cipher_class->set_key = purple_rc4_cipher_set_key;
 
-	pspec = g_param_spec_int("key_len", "key_len", "key_len",
+	pspec = g_param_spec_int("key-len", "key-len", "key-len",
 							 G_MININT, G_MAXINT, 0,
-							 G_PARAM_READWRITE);
+							 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_KEY_LEN, pspec);
 
 	pspec = g_param_spec_string("key", "key", "key", NULL,
-								G_PARAM_WRITABLE);
+								G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_KEY, pspec);
 
 	g_type_class_add_private(klass, sizeof(PurpleRC4CipherPrivate));
@@ -241,6 +241,8 @@ 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/media.c b/libpurple/media.c
--- a/libpurple/media.c
+++ b/libpurple/media.c
@@ -184,7 +184,8 @@ purple_media_class_init (PurpleMediaClas
 			"Purple Media Manager",
 			"The media manager that contains this media session.",
 			PURPLE_TYPE_MEDIA_MANAGER,
-			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
+			G_PARAM_STATIC_STRINGS));
 
 	/*
 	 * This one should be PURPLE_TYPE_MEDIA_BACKEND, but it doesn't
@@ -195,12 +196,13 @@ purple_media_class_init (PurpleMediaClas
 			"Purple Media Backend",
 			"The backend object this media object uses.",
 			G_TYPE_OBJECT,
-			G_PARAM_READABLE));
+			G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property(gobject_class, PROP_ACCOUNT,
 			g_param_spec_pointer("account", "PurpleAccount",
 			"The account this media session is on.",
-			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
+			G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property(gobject_class, PROP_CONFERENCE_TYPE,
 			g_param_spec_string("conference-type",
@@ -208,20 +210,22 @@ purple_media_class_init (PurpleMediaClas
 			"The type of conference that this media object "
 			"has been created to provide.",
 			NULL,
-			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
+			G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property(gobject_class, PROP_INITIATOR,
 			g_param_spec_boolean("initiator",
 			"initiator",
 			"If the local user initiated the conference.",
 			FALSE,
-			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
+			G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property(gobject_class, PROP_PROTOCOL_DATA,
 			g_param_spec_pointer("protocol-data",
 			"gpointer",
 			"Data the protocol set on the media session.",
-			G_PARAM_READWRITE));
+			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
 	purple_media_signals[S_ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass),
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
diff --git a/libpurple/media/backend-iface.c b/libpurple/media/backend-iface.c
--- a/libpurple/media/backend-iface.c
+++ b/libpurple/media/backend-iface.c
@@ -53,7 +53,8 @@ purple_media_backend_base_init(gpointer 
 			"The type of conference that this backend "
 			"has been created to provide.",
 			NULL,
-			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
+			G_PARAM_STATIC_STRINGS));
 	g_object_interface_install_property(iface,
 #ifdef USE_VV
 			g_param_spec_object(
@@ -65,7 +66,8 @@ purple_media_backend_base_init(gpointer 
 #ifdef USE_VV
 			PURPLE_TYPE_MEDIA,
 #endif
-			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+			G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
+			G_PARAM_STATIC_STRINGS));
 	purple_media_backend_signals[S_ERROR] =
 			g_signal_new("error", G_TYPE_FROM_CLASS(iface),
 			G_SIGNAL_RUN_LAST, 0, NULL, NULL,
diff --git a/libpurple/media/candidate.c b/libpurple/media/candidate.c
--- a/libpurple/media/candidate.c
+++ b/libpurple/media/candidate.c
@@ -237,42 +237,42 @@ purple_media_candidate_class_init(Purple
 			"Foundation",
 			"The foundation of the candidate.",
 			NULL,
-			G_PARAM_READWRITE));
+			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property(gobject_class, PROP_COMPONENT_ID,
 			g_param_spec_uint("component-id",
 			"Component ID",
 			"The component id of the candidate.",
 			0, G_MAXUINT, 0,
-			G_PARAM_READWRITE));
+			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property(gobject_class, PROP_IP,
 			g_param_spec_string("ip",
 			"IP Address",
 			"The IP address of the candidate.",
 			NULL,
-			G_PARAM_READWRITE));
+			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property(gobject_class, PROP_PORT,
 			g_param_spec_uint("port",
 			"Port",
 			"The port of the candidate.",
 			0, G_MAXUINT16, 0,
-			G_PARAM_READWRITE));
+			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property(gobject_class, PROP_BASE_IP,
 			g_param_spec_string("base-ip",
 			"Base IP",
 			"The internal IP address of the candidate.",
 			NULL,
-			G_PARAM_READWRITE));
+			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property(gobject_class, PROP_BASE_PORT,
 			g_param_spec_uint("base-port",
 			"Base Port",
 			"The internal port of the candidate.",
 			0, G_MAXUINT16, 0,
-			G_PARAM_READWRITE));
+			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property(gobject_class, PROP_PROTOCOL,
 			g_param_spec_enum("protocol",
@@ -280,14 +280,14 @@ purple_media_candidate_class_init(Purple
 			"The protocol of the candidate.",
 			PURPLE_TYPE_MEDIA_NETWORK_PROTOCOL,
 			PURPLE_MEDIA_NETWORK_PROTOCOL_UDP,
-			G_PARAM_READWRITE));
+			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property(gobject_class, PROP_PRIORITY,
 			g_param_spec_uint("priority",
 			"Priority",
 			"The priority of the candidate.",
 			0, G_MAXUINT32, 0,
-			G_PARAM_READWRITE));



More information about the Commits mailing list