/soc/2013/ankitkv/gobjectification: 0d56a4091806: Use glibcompat...

Ankit Vani a at nevitus.org
Tue Nov 19 03:39:00 EST 2013


Changeset: 0d56a40918065b84a949d8f08e5b18486af23d5b
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-11-19 13:58 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/0d56a4091806

Description:

Use glibcompat.h for "notify" in gtkconv-theme.c

diffstat:

 pidgin/gtkconv-theme.c |  24 ++++++------------------
 1 files changed, 6 insertions(+), 18 deletions(-)

diffs (78 lines):

diff --git a/pidgin/gtkconv-theme.c b/pidgin/gtkconv-theme.c
--- a/pidgin/gtkconv-theme.c
+++ b/pidgin/gtkconv-theme.c
@@ -21,6 +21,7 @@
  */
 
 #include "internal.h"
+#include "glibcompat.h"
 
 #include "gtkconv-theme.h"
 
@@ -87,9 +88,7 @@ enum {
  *****************************************************************************/
 
 static GObjectClass *parent_class = NULL;
-#if GLIB_CHECK_VERSION(2,26,0)
 static GParamSpec *properties[PROP_LAST];
-#endif
 
 /******************************************************************************
  * Helper Functions
@@ -495,7 +494,6 @@ static void
 pidgin_conv_theme_class_init(PidginConvThemeClass *klass)
 {
 	GObjectClass *obj_class = G_OBJECT_CLASS(klass);
-	GParamSpec *pspec;
 
 	parent_class = g_type_class_peek_parent(klass);
 
@@ -506,23 +504,17 @@ pidgin_conv_theme_class_init(PidginConvT
 	obj_class->finalize = pidgin_conv_theme_finalize;
 
 	/* INFO */
-	pspec = g_param_spec_boxed("info", "Info",
+	properties[PROP_INFO] = g_param_spec_boxed("info", "Info",
 			"The information about this theme",
 			G_TYPE_HASH_TABLE,
 			G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_INFO, pspec);
-#if GLIB_CHECK_VERSION(2,26,0)
-	properties[PROP_INFO] = pspec;
-#endif
+	g_object_class_install_property(obj_class, PROP_INFO, properties[PROP_INFO]);
 
 	/* VARIANT */
-	pspec = g_param_spec_string("variant", "Variant",
+	properties[PROP_VARIANT] = g_param_spec_string("variant", "Variant",
 			"The current variant for this theme",
 			NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_VARIANT, pspec);
-#if GLIB_CHECK_VERSION(2,26,0)
-	properties[PROP_VARIANT] = pspec;
-#endif
+	g_object_class_install_property(obj_class, PROP_VARIANT, properties[PROP_VARIANT]);
 }
 
 GType
@@ -577,7 +569,7 @@ pidgin_conversation_theme_set_info(Pidgi
 
 	priv->info = info;
 
-	g_object_notify(G_OBJECT(theme), "info");
+	g_object_notify_by_pspec(G_OBJECT(theme), properties[PROP_INFO]);
 }
 
 const GValue *
@@ -706,11 +698,7 @@ pidgin_conversation_theme_set_variant(Pi
 	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
-	g_object_notify(G_OBJECT(theme), "variant");
-#endif
 }
 
 const GList *



More information about the Commits mailing list