Sun, 17 Nov 2013 16:01:44 +0530
Merged soc.2013.gobjectification branch
--- a/libpurple/ciphers/aescipher.c Sun Nov 17 04:24:05 2013 +0530 +++ b/libpurple/ciphers/aescipher.c Sun Nov 17 16:01:44 2013 +0530 @@ -107,6 +107,8 @@ 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 @@ memset(priv->key, 0, sizeof(priv->key)); if (len > 0) memcpy(priv->key, key, len); + + g_object_notify(G_OBJECT(cipher), "key"); } static guchar *
--- a/libpurple/ciphers/des3cipher.c Sun Nov 17 04:24:05 2013 +0530 +++ b/libpurple/ciphers/des3cipher.c Sun Nov 17 16:01:44 2013 +0530 @@ -101,6 +101,8 @@ 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 @@ g_return_if_fail(len == 8); memcpy(priv->iv, iv, len); + + g_object_notify(G_OBJECT(cipher), "iv"); } /******************************************************************************
--- a/libpurple/ciphers/descipher.c Sun Nov 17 04:24:05 2013 +0530 +++ b/libpurple/ciphers/descipher.c Sun Nov 17 16:01:44 2013 +0530 @@ -383,6 +383,8 @@ 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
--- a/libpurple/ciphers/hmaccipher.c Sun Nov 17 04:24:05 2013 +0530 +++ b/libpurple/ciphers/hmaccipher.c Sun Nov 17 16:01:44 2013 +0530 @@ -60,6 +60,8 @@ PurpleHMACCipherPrivate *priv = PURPLE_HMAC_CIPHER_GET_PRIVATE(cipher); priv->hash = g_object_ref(G_OBJECT(hash)); + + g_object_notify(G_OBJECT(cipher), "hash"); } /*******************************************************************************
--- a/libpurple/ciphers/pbkdf2cipher.c Sun Nov 17 04:24:05 2013 +0530 +++ b/libpurple/ciphers/pbkdf2cipher.c Sun Nov 17 16:01:44 2013 +0530 @@ -72,6 +72,8 @@ PurplePBKDF2CipherPrivate *priv = PURPLE_PBKDF2_CIPHER_GET_PRIVATE(cipher); priv->hash = g_object_ref(G_OBJECT(hash)); + + g_object_notify(G_OBJECT(cipher), "hash"); } /******************************************************************************
--- a/libpurple/ciphers/rc4cipher.c Sun Nov 17 04:24:05 2013 +0530 +++ b/libpurple/ciphers/rc4cipher.c Sun Nov 17 16:01:44 2013 +0530 @@ -89,6 +89,8 @@ state[y] = temp_swap; x = (x + 1) % len; } + + g_object_notify(G_OBJECT(cipher), "key"); } static ssize_t
--- a/libpurple/protocols/jabber/google/google_p2p.c Sun Nov 17 04:24:05 2013 +0530 +++ b/libpurple/protocols/jabber/google/google_p2p.c Sun Nov 17 16:01:44 2013 +0530 @@ -262,12 +262,17 @@ 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 * @@ -330,6 +335,8 @@ 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 *
--- a/libpurple/protocols/jabber/jingle/iceudp.c Sun Nov 17 04:24:05 2013 +0530 +++ b/libpurple/protocols/jabber/jingle/iceudp.c Sun Nov 17 16:01:44 2013 +0530 @@ -277,12 +277,17 @@ 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 * @@ -346,6 +351,8 @@ 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 *
--- a/libpurple/protocols/jabber/jingle/rawudp.c Sun Nov 17 04:24:05 2013 +0530 +++ b/libpurple/protocols/jabber/jingle/rawudp.c Sun Nov 17 16:01:44 2013 +0530 @@ -228,12 +228,17 @@ 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 * @@ -280,6 +285,8 @@ 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 *
--- a/libpurple/smiley.c Sun Nov 17 04:24:05 2013 +0530 +++ b/libpurple/smiley.c Sun Nov 17 16:01:44 2013 +0530 @@ -408,13 +408,13 @@ 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",
--- a/libpurple/theme-loader.c Sun Nov 17 04:24:05 2013 +0530 +++ b/libpurple/theme-loader.c Sun Nov 17 16:01:44 2013 +0530 @@ -130,7 +130,8 @@ 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 @@ g_free(priv->type); priv->type = g_strdup(type); + + g_object_notify(G_OBJECT(loader), "type"); } PurpleTheme *
--- a/libpurple/theme.c Sun Nov 17 04:24:05 2013 +0530 +++ b/libpurple/theme.c Sun Nov 17 16:01:44 2013 +0530 @@ -162,42 +162,43 @@ 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 @@ g_free(priv->name); priv->name = theme_clean_text(name); + + g_object_notify(G_OBJECT(theme), "name"); } const gchar * @@ -291,6 +294,8 @@ g_free(priv->description); priv->description = theme_clean_text(description); + + g_object_notify(G_OBJECT(theme), "description"); } const gchar * @@ -315,6 +320,8 @@ g_free(priv->author); priv->author = theme_clean_text(author); + + g_object_notify(G_OBJECT(theme), "author"); } const gchar * @@ -340,6 +347,8 @@ g_free(priv->type); priv->type = g_strdup(type); + + g_object_notify(G_OBJECT(theme), "type"); } const gchar * @@ -364,6 +373,8 @@ g_free(priv->dir); priv->dir = g_strdup(dir); + + g_object_notify(G_OBJECT(theme), "directory"); } const gchar * @@ -400,4 +411,6 @@ g_free(priv->img); priv->img = g_strdup(img); + + g_object_notify(G_OBJECT(theme), "image"); }
--- a/pidgin/gtkconv-theme.c Sun Nov 17 04:24:05 2013 +0530 +++ b/pidgin/gtkconv-theme.c Sun Nov 17 16:01:44 2013 +0530 @@ -394,30 +394,6 @@ return priv->outgoing_next_context_html; } -static void -_set_variant(PidginConvTheme *theme, const char *variant) -{ - PidginConvThemePrivate *priv; - const GValue *val; - char *prefname; - - g_return_if_fail(theme != NULL); - g_return_if_fail(variant != NULL); - - priv = PIDGIN_CONV_THEME_GET_PRIVATE(theme); - - g_free(priv->variant); - priv->variant = g_strdup(variant); - - val = get_key(priv, "CFBundleIdentifier", FALSE); - prefname = g_strdup_printf(PIDGIN_PREFS_ROOT "/conversations/themes/%s/variant", - g_value_get_string(val)); - purple_prefs_set_string(prefname, variant); - g_free(prefname); - - g_object_notify(G_OBJECT(theme), "variant"); -} - /****************************************************************************** * GObject Stuff *****************************************************************************/ @@ -455,7 +431,7 @@ break; case PROP_VARIANT: - _set_variant(theme, g_value_get_string(value)); + pidgin_conversation_theme_set_variant(theme, g_value_get_string(value)); break; default: @@ -712,7 +688,24 @@ void pidgin_conversation_theme_set_variant(PidginConvTheme *theme, const char *variant) { - _set_variant(theme, variant); + PidginConvThemePrivate *priv; + const GValue *val; + char *prefname; + + g_return_if_fail(theme != NULL); + g_return_if_fail(variant != NULL); + + priv = PIDGIN_CONV_THEME_GET_PRIVATE(theme); + + g_free(priv->variant); + priv->variant = g_strdup(variant); + + val = get_key(priv, "CFBundleIdentifier", FALSE); + prefname = g_strdup_printf(PIDGIN_PREFS_ROOT "/conversations/themes/%s/variant", + g_value_get_string(val)); + purple_prefs_set_string(prefname, variant); + g_free(prefname); + #if GLIB_CHECK_VERSION(2,26,0) g_object_notify_by_pspec(G_OBJECT(theme), properties[PROP_VARIANT]); #else