/soc/2013/ankitkv/gobjectification: 05a66637ec23: pidgin: use g_...

Ankit Vani a at nevitus.org
Sat Nov 23 15:46:27 EST 2013


Changeset: 05a66637ec23fbdf591d025f2cce6f57d9f104ca
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-11-24 01:53 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/05a66637ec23

Description:

pidgin: use g_object_class_install_properties instead of repeated g_object_class_install_property

diffstat:

 pidgin/gtkblist-theme.c |  35 ++---------------------------------
 pidgin/gtkconv-theme.c  |   4 ++--
 pidgin/minidialog.c     |  18 +++++-------------
 3 files changed, 9 insertions(+), 48 deletions(-)

diffs (187 lines):

diff --git a/pidgin/gtkblist-theme.c b/pidgin/gtkblist-theme.c
--- a/pidgin/gtkblist-theme.c
+++ b/pidgin/gtkblist-theme.c
@@ -373,114 +373,83 @@ pidgin_blist_theme_class_init(PidginBlis
 			"Background Color",
 			"The background color for the buddy list",
 			GDK_TYPE_COLOR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_BACKGROUND_COLOR,
-			properties[PROP_BACKGROUND_COLOR]);
 
 	properties[PROP_OPACITY] = g_param_spec_double("opacity", "Opacity",
 			"The opacity of the buddy list",
 			0.0, 1.0, 1.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_OPACITY,
-			properties[PROP_OPACITY]);
 
 	properties[PROP_LAYOUT] = g_param_spec_pointer("layout", "Layout",
 			"The layout of icons, name, and status of the buddy list",
 			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 
-	g_object_class_install_property(obj_class, PROP_LAYOUT,
-			properties[PROP_LAYOUT]);
-
 	/* Group */
 	properties[PROP_EXPANDED_COLOR] = g_param_spec_boxed("expanded-color",
 			"Expanded Background Color",
 			"The background color of an expanded group",
 			GDK_TYPE_COLOR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_EXPANDED_COLOR,
-			properties[PROP_EXPANDED_COLOR]);
 
 	properties[PROP_EXPANDED_TEXT] = g_param_spec_pointer("expanded-text",
 			"Expanded Text",
 			"The text information for when a group is expanded",
 			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_EXPANDED_TEXT,
-			properties[PROP_EXPANDED_TEXT]);
 
 	properties[PROP_COLLAPSED_COLOR] = g_param_spec_boxed("collapsed-color",
 			"Collapsed Background Color",
 			"The background color of a collapsed group",
 			GDK_TYPE_COLOR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_COLLAPSED_COLOR,
-			properties[PROP_COLLAPSED_COLOR]);
 
 	properties[PROP_COLLAPSED_TEXT] = g_param_spec_pointer("collapsed-text",
 			"Collapsed Text",
 			"The text information for when a group is collapsed",
 			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_COLLAPSED_TEXT,
-			properties[PROP_COLLAPSED_TEXT]);
 
 	/* Buddy */
 	properties[PROP_CONTACT_COLOR] = g_param_spec_boxed("contact-color",
 			"Contact/Chat Background Color",
 			"The background color of a contact or chat",
 			GDK_TYPE_COLOR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_CONTACT_COLOR,
-			properties[PROP_CONTACT_COLOR]);
 
 	properties[PROP_CONTACT] = g_param_spec_pointer("contact",
 			"Contact Text",
 			"The text information for when a contact is expanded",
 			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_CONTACT,
-			properties[PROP_CONTACT]);
 
 	properties[PROP_ONLINE] = g_param_spec_pointer("online",
 			"Online Text",
 			"The text information for when a buddy is online",
 			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_ONLINE,
-			properties[PROP_ONLINE]);
 
 	properties[PROP_AWAY] = g_param_spec_pointer("away",
 			"Away Text",
 			"The text information for when a buddy is away",
 			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_AWAY,
-			properties[PROP_AWAY]);
 
 	properties[PROP_OFFLINE] = g_param_spec_pointer("offline",
 			"Offline Text",
 			"The text information for when a buddy is offline",
 			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_OFFLINE,
-			properties[PROP_OFFLINE]);
 
 	properties[PROP_IDLE] = g_param_spec_pointer("idle",
 			"Idle Text",
 			"The text information for when a buddy is idle",
 			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_IDLE,
-			properties[PROP_IDLE]);
 
 	properties[PROP_MESSAGE] = g_param_spec_pointer("message",
 			"Message Text",
 			"The text information for when a buddy has an unread message",
 			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_MESSAGE,
-			properties[PROP_MESSAGE]);
 
 	properties[PROP_MESSAGE_NICK_SAID] = g_param_spec_pointer("message-nick-said",
 			"Message (Nick Said) Text",
 			"The text information for when a chat has an unread message that mentions your nickname",
 			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_MESSAGE_NICK_SAID,
-			properties[PROP_MESSAGE_NICK_SAID]);
 
 	properties[PROP_STATUS] = g_param_spec_pointer("status",
 			"Status Text",
 			"The text information for a buddy's status",
 			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, PROP_STATUS,
-			properties[PROP_STATUS]);
+
+	g_object_class_install_properties(obj_class, PROP_LAST, properties);
 }
 
 GType
diff --git a/pidgin/gtkconv-theme.c b/pidgin/gtkconv-theme.c
--- a/pidgin/gtkconv-theme.c
+++ b/pidgin/gtkconv-theme.c
@@ -508,13 +508,13 @@ pidgin_conv_theme_class_init(PidginConvT
 			"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, properties[PROP_INFO]);
 
 	/* 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, properties[PROP_VARIANT]);
+
+	g_object_class_install_properties(obj_class, PROP_LAST, properties);
 }
 
 GType
diff --git a/pidgin/minidialog.c b/pidgin/minidialog.c
--- a/pidgin/minidialog.c
+++ b/pidgin/minidialog.c
@@ -422,39 +422,31 @@ pidgin_mini_dialog_class_init(PidginMini
 		"title",
 		"String specifying the mini-dialog's title", NULL,
 		G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE);
-	g_object_class_install_property (object_class, PROP_TITLE,
-		properties[PROP_TITLE]);
 
 	properties[PROP_DESCRIPTION] = g_param_spec_string("description",
-	"description",
+		"description",
 		"Description text for the mini-dialog, if desired", NULL,
 		G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE);
-	g_object_class_install_property (object_class, PROP_DESCRIPTION,
-		properties[PROP_DESCRIPTION]);
 
 	properties[PROP_ICON_NAME] = g_param_spec_string("icon-name",
-	"icon-name",
+		"icon-name",
 		"String specifying the Gtk stock name of the dialog's icon",
 		NULL,
 		G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE);
-	g_object_class_install_property (object_class, PROP_ICON_NAME,
-		properties[PROP_ICON_NAME]);
 
 	properties[PROP_CUSTOM_ICON] = g_param_spec_object("custom-icon",
-	"custom-icon",
+		"custom-icon",
 		"Pixbuf to use as the dialog's icon",
 		GDK_TYPE_PIXBUF,
 		G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE);
-	g_object_class_install_property (object_class, PROP_CUSTOM_ICON,
-		properties[PROP_CUSTOM_ICON]);
 
 	properties[PROP_ENABLE_DESCRIPTION_MARKUP] =
 		g_param_spec_boolean("enable-description-markup",
 		"enable-description-markup",
 		"Use GMarkup in the description text", FALSE,
 		G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE);
-	g_object_class_install_property (object_class, PROP_ENABLE_DESCRIPTION_MARKUP,
-		properties[PROP_ENABLE_DESCRIPTION_MARKUP]);
+
+	g_object_class_install_properties(object_class, LAST_PROPERTY, properties);
 }
 
 #if !GTK_CHECK_VERSION(3,0,0)



More information about the Commits mailing list