/soc/2013/ankitkv/gobjectification: 2fe1b3f20c3c: Added a few mi...

Ankit Vani a at nevitus.org
Sun Nov 17 05:27:33 EST 2013


Changeset: 2fe1b3f20c3c7a3469049c1da0aca8f96c348c54
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-11-17 15:56 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/2fe1b3f20c3c

Description:

Added a few missing G_PARAM_STATIC_STRINGS and g_object_notify

diffstat:

 libpurple/ciphers/aescipher.c                  |   4 ++++
 libpurple/ciphers/des3cipher.c                 |   4 ++++
 libpurple/ciphers/descipher.c                  |   2 ++
 libpurple/ciphers/hmaccipher.c                 |   2 ++
 libpurple/ciphers/pbkdf2cipher.c               |   2 ++
 libpurple/ciphers/rc4cipher.c                  |   2 ++
 libpurple/protocols/jabber/google/google_p2p.c |   7 +++++++
 libpurple/protocols/jabber/jingle/iceudp.c     |   7 +++++++
 libpurple/protocols/jabber/jingle/rawudp.c     |   7 +++++++
 libpurple/smiley.c                             |   4 ++--
 libpurple/theme-loader.c                       |   5 ++++-
 libpurple/theme.c                              |  25 +++++++++++++++++++------
 12 files changed, 62 insertions(+), 9 deletions(-)

diffs (truncated from 326 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
@@ -107,6 +107,8 @@ 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,6 +127,8 @@ 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 *
diff --git a/libpurple/ciphers/des3cipher.c b/libpurple/ciphers/des3cipher.c
--- a/libpurple/ciphers/des3cipher.c
+++ b/libpurple/ciphers/des3cipher.c
@@ -101,6 +101,8 @@ 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(cipher), "key");
 }
 
 static ssize_t
@@ -374,6 +376,8 @@ purple_des3_cipher_set_iv(PurpleCipher *
 	g_return_if_fail(len == 8);
 
 	memcpy(priv->iv, iv, len);
+
+	g_object_notify(G_OBJECT(cipher), "iv");
 }
 
 /******************************************************************************
diff --git a/libpurple/ciphers/descipher.c b/libpurple/ciphers/descipher.c
--- a/libpurple/ciphers/descipher.c
+++ b/libpurple/ciphers/descipher.c
@@ -383,6 +383,8 @@ 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
@@ -60,6 +60,8 @@ 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,6 +72,8 @@ 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
@@ -89,6 +89,8 @@ purple_rc4_cipher_set_key(PurpleCipher *
 		state[y] = temp_swap;
 		x = (x + 1) % len;
 	}
+
+	g_object_notify(G_OBJECT(cipher), "key");
 }
 
 static ssize_t
diff --git a/libpurple/protocols/jabber/google/google_p2p.c b/libpurple/protocols/jabber/google/google_p2p.c
--- a/libpurple/protocols/jabber/google/google_p2p.c
+++ b/libpurple/protocols/jabber/google/google_p2p.c
@@ -283,12 +283,17 @@ jingle_google_p2p_add_local_candidate(Ji
 
 			google_p2p->priv->local_candidates = g_list_append(
 					google_p2p->priv->local_candidates, candidate);
+
+			g_object_notify(G_OBJECT(google_p2p), "local-candidates");
+
 			return;
 		}
 	}
 
 	google_p2p->priv->local_candidates = g_list_append(
 			google_p2p->priv->local_candidates, google_p2p_candidate);
+
+	g_object_notify(G_OBJECT(google_p2p), "local-candidates");
 }
 
 static GList *
@@ -351,6 +356,8 @@ jingle_google_p2p_add_remote_candidate(J
 		g_boxed_free(JINGLE_TYPE_GOOGLE_P2P_CANDIDATE, google_p2p_candidate);
 	}
 	priv->remote_candidates = g_list_append(priv->remote_candidates, candidate);
+
+	g_object_notify(G_OBJECT(google_p2p), "remote-candidates");
 }
 
 static JingleTransport *
diff --git a/libpurple/protocols/jabber/jingle/iceudp.c b/libpurple/protocols/jabber/jingle/iceudp.c
--- a/libpurple/protocols/jabber/jingle/iceudp.c
+++ b/libpurple/protocols/jabber/jingle/iceudp.c
@@ -298,12 +298,17 @@ jingle_iceudp_add_local_candidate(Jingle
 
 			iceudp->priv->local_candidates = g_list_append(
 					iceudp->priv->local_candidates, iceudp_candidate);
+
+			g_object_notify(G_OBJECT(iceudp), "local-candidates");
+
 			return;
 		}
 	}
 
 	iceudp->priv->local_candidates = g_list_append(
 			iceudp->priv->local_candidates, iceudp_candidate);
+
+	g_object_notify(G_OBJECT(iceudp), "local-candidates");
 }
 
 static GList *
@@ -367,6 +372,8 @@ jingle_iceudp_add_remote_candidate(Jingl
 		g_boxed_free(JINGLE_TYPE_ICEUDP_CANDIDATE, iceudp_candidate);
 	}
 	priv->remote_candidates = g_list_append(priv->remote_candidates, candidate);
+
+	g_object_notify(G_OBJECT(iceudp), "remote-candidates");
 }
 
 static JingleTransport *
diff --git a/libpurple/protocols/jabber/jingle/rawudp.c b/libpurple/protocols/jabber/jingle/rawudp.c
--- a/libpurple/protocols/jabber/jingle/rawudp.c
+++ b/libpurple/protocols/jabber/jingle/rawudp.c
@@ -249,12 +249,17 @@ jingle_rawudp_add_local_candidate(Jingle
 
 			rawudp->priv->local_candidates = g_list_append(
 					rawudp->priv->local_candidates, rawudp_candidate);
+
+			g_object_notify(G_OBJECT(rawudp), "local-candidates");
+
 			return;
 		}
 	}
 
 	rawudp->priv->local_candidates = g_list_append(
 			rawudp->priv->local_candidates, rawudp_candidate);
+
+	g_object_notify(G_OBJECT(rawudp), "local-candidates");
 }
 
 static GList *
@@ -301,6 +306,8 @@ jingle_rawudp_add_remote_candidate(Jingl
 		g_boxed_free(JINGLE_TYPE_RAWUDP_CANDIDATE, rawudp_candidate);
 	}
 	priv->remote_candidates = g_list_append(priv->remote_candidates, candidate);
+
+	g_object_notify(G_OBJECT(rawudp), "remote-candidates");
 }
 
 static JingleTransport *
diff --git a/libpurple/smiley.c b/libpurple/smiley.c
--- a/libpurple/smiley.c
+++ b/libpurple/smiley.c
@@ -408,13 +408,13 @@ purple_smiley_class_init(PurpleSmileyCla
 	pspec = g_param_spec_string("shortcut", "Shortcut",
 			"The text-shortcut for the smiley",
 			NULL,
-			G_PARAM_READWRITE);
+			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(gobj_class, PROP_SHORTCUT, pspec);
 
 	/* Stored Image */
 	pspec = g_param_spec_pointer("image", "Stored Image",
 			"Stored Image. (that'll have to do for now)",
-			G_PARAM_READWRITE);
+			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(gobj_class, PROP_IMGSTORE, pspec);
 
 	signals[SIG_DESTROY] = g_signal_new("destroy",
diff --git a/libpurple/theme-loader.c b/libpurple/theme-loader.c
--- a/libpurple/theme-loader.c
+++ b/libpurple/theme-loader.c
@@ -130,7 +130,8 @@ purple_theme_loader_class_init(PurpleThe
 	pspec = g_param_spec_string("type", "Type",
 				    "The string representing the type of the theme",
 				    NULL,
-				    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_TYPE, pspec);
 }
 
@@ -184,6 +185,8 @@ purple_theme_loader_set_type_string(Purp
 
 	g_free(priv->type);
 	priv->type = g_strdup(type);
+
+	g_object_notify(G_OBJECT(loader), "type");
 }
 
 PurpleTheme *
diff --git a/libpurple/theme.c b/libpurple/theme.c
--- a/libpurple/theme.c
+++ b/libpurple/theme.c
@@ -162,42 +162,43 @@ purple_theme_class_init(PurpleThemeClass
 	pspec = g_param_spec_string("name", "Name",
 			"The name of the theme",
 			NULL,
-			G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
+			G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_NAME, pspec);
 
 	/* DESCRIPTION */
 	pspec = g_param_spec_string("description", "Description",
 			"The description of the theme",
 			NULL,
-			G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
+			G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_DESCRIPTION, pspec);
 
 	/* AUTHOR */
 	pspec = g_param_spec_string("author", "Author",
 			"The author of the theme",
 			NULL,
-			G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
+			G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_AUTHOR, pspec);
 
 	/* TYPE STRING (read only) */
 	pspec = g_param_spec_string("type", "Type",
 			"The string representing the type of the theme",
 			NULL,
-			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_TYPE, pspec);
 
 	/* DIRECTORY */
 	pspec = g_param_spec_string("directory", "Directory",
 			"The directory that contains the theme and all its files",
 			NULL,
-			G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
+			G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_DIR, pspec);
 
 	/* PREVIEW IMAGE */
 	pspec = g_param_spec_string("image", "Image",
 			"A preview image of the theme",
 			NULL,
-			G_PARAM_READWRITE);
+			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property(obj_class, PROP_IMAGE, pspec);
 }
 
@@ -267,6 +268,8 @@ purple_theme_set_name(PurpleTheme *theme
 
 	g_free(priv->name);
 	priv->name = theme_clean_text(name);
+
+	g_object_notify(G_OBJECT(theme), "name");
 }
 
 const gchar *
@@ -291,6 +294,8 @@ purple_theme_set_description(PurpleTheme
 
 	g_free(priv->description);
 	priv->description = theme_clean_text(description);
+
+	g_object_notify(G_OBJECT(theme), "description");
 }
 
 const gchar *
@@ -315,6 +320,8 @@ purple_theme_set_author(PurpleTheme *the
 
 	g_free(priv->author);
 	priv->author = theme_clean_text(author);
+
+	g_object_notify(G_OBJECT(theme), "author");
 }
 



More information about the Commits mailing list