libpurple/blistnodetypes.c

branch
soc.2013.gobjectification
changeset 35085
abab0adfa0ec
parent 35080
58bddd91956c
child 35090
c181fdc1ceac
child 36959
4806ff428ecd
--- a/libpurple/blistnodetypes.c	Sun Nov 24 02:02:31 2013 +0530
+++ b/libpurple/blistnodetypes.c	Sun Nov 24 02:16:14 2013 +0530
@@ -695,56 +695,45 @@
 	obj_class->set_property = purple_buddy_set_property;
 	obj_class->constructed = purple_buddy_constructed;
 
+	g_type_class_add_private(klass, sizeof(PurpleBuddyPrivate));
+
 	bd_properties[BUDDY_PROP_NAME] = g_param_spec_string("name", "Name",
 				"The name of the buddy.", NULL,
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, BUDDY_PROP_NAME,
-				bd_properties[BUDDY_PROP_NAME]);
 
 	bd_properties[BUDDY_PROP_LOCAL_ALIAS] = g_param_spec_string("local-alias",
 				"Local alias",
 				"Local alias of thee buddy.", NULL,
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, BUDDY_PROP_LOCAL_ALIAS,
-				bd_properties[BUDDY_PROP_LOCAL_ALIAS]);
 
 	bd_properties[BUDDY_PROP_SERVER_ALIAS] = g_param_spec_string("server-alias",
 				"Server alias",
 				"Server-side alias of the buddy.", NULL,
 				G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, BUDDY_PROP_SERVER_ALIAS,
-				bd_properties[BUDDY_PROP_SERVER_ALIAS]);
 
 	bd_properties[BUDDY_PROP_ICON] = g_param_spec_pointer("icon", "Buddy icon",
 				"The icon for the buddy.",
 				G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, BUDDY_PROP_ICON,
-				bd_properties[BUDDY_PROP_ICON]);
 
 	bd_properties[BUDDY_PROP_ACCOUNT] = g_param_spec_object("account",
 				"Account",
 				"The account for the buddy.", PURPLE_TYPE_ACCOUNT,
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
 				G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, BUDDY_PROP_ACCOUNT,
-				bd_properties[BUDDY_PROP_ACCOUNT]);
 
 	bd_properties[BUDDY_PROP_PRESENCE] = g_param_spec_object("presence",
 				"Presence",
 				"The status information for the buddy.", PURPLE_TYPE_PRESENCE,
 				G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, BUDDY_PROP_PRESENCE,
-				bd_properties[BUDDY_PROP_PRESENCE]);
 
 	bd_properties[BUDDY_PROP_MEDIA_CAPS] = g_param_spec_enum("media-caps",
 				"Media capabilities",
 				"The media capabilities of the buddy.",
 				PURPLE_MEDIA_TYPE_CAPS, PURPLE_MEDIA_CAPS_NONE,
 				G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, BUDDY_PROP_MEDIA_CAPS,
-				bd_properties[BUDDY_PROP_MEDIA_CAPS]);
 
-	g_type_class_add_private(klass, sizeof(PurpleBuddyPrivate));
+	g_object_class_install_properties(obj_class, BUDDY_PROP_LAST,
+				bd_properties);
 }
 
 GType
@@ -1068,20 +1057,19 @@
 	obj_class->get_property = purple_contact_get_property;
 	obj_class->set_property = purple_contact_set_property;
 
+	g_type_class_add_private(klass, sizeof(PurpleContactPrivate));
+
 	co_properties[CONTACT_PROP_ALIAS] = g_param_spec_string("alias", "Alias",
 				"The alias for the contact.", NULL,
 				G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, CONTACT_PROP_ALIAS,
-				co_properties[CONTACT_PROP_ALIAS]);
 
 	co_properties[CONTACT_PROP_PRIORITY_BUDDY] = g_param_spec_object(
 				"priority-buddy",
 				"Priority buddy", "The priority buddy of the contact.",
 				PURPLE_TYPE_BUDDY, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, CONTACT_PROP_PRIORITY_BUDDY,
-				co_properties[CONTACT_PROP_PRIORITY_BUDDY]);
 
-	g_type_class_add_private(klass, sizeof(PurpleContactPrivate));
+	g_object_class_install_properties(obj_class, CONTACT_PROP_LAST,
+				co_properties);
 }
 
 GType
@@ -1327,28 +1315,24 @@
 	obj_class->set_property = purple_chat_set_property;
 	obj_class->constructed = purple_chat_constructed;
 
+	g_type_class_add_private(klass, sizeof(PurpleChatPrivate));
+
 	ch_properties[CHAT_PROP_ALIAS] = g_param_spec_string("alias", "Alias",
 				"The alias for the chat.", NULL,
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, CHAT_PROP_ALIAS,
-				ch_properties[CHAT_PROP_ALIAS]);
 
 	ch_properties[CHAT_PROP_ACCOUNT] = g_param_spec_object("account", "Account",
 				"The account that the chat belongs to.", PURPLE_TYPE_ACCOUNT,
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
 				G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, CHAT_PROP_ACCOUNT,
-				ch_properties[CHAT_PROP_ACCOUNT]);
 
 	ch_properties[CHAT_PROP_COMPONENTS] = g_param_spec_pointer("components",
 				"Components",
 				"The protocol components of the chat.",
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
 				G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, CHAT_PROP_COMPONENTS,
-				ch_properties[CHAT_PROP_COMPONENTS]);
 
-	g_type_class_add_private(klass, sizeof(PurpleChatPrivate));
+	g_object_class_install_properties(obj_class, CHAT_PROP_LAST, ch_properties);
 }
 
 GType
@@ -1674,13 +1658,14 @@
 	obj_class->get_property = purple_group_get_property;
 	obj_class->set_property = purple_group_set_property;
 
+	g_type_class_add_private(klass, sizeof(PurpleGroupPrivate));
+
 	gr_properties[GROUP_PROP_NAME] = g_param_spec_string("name", "Name",
 				"Name of the group.", NULL,
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
-	g_object_class_install_property(obj_class, GROUP_PROP_NAME,
-				gr_properties[GROUP_PROP_NAME]);
 
-	g_type_class_add_private(klass, sizeof(PurpleGroupPrivate));
+	g_object_class_install_properties(obj_class, GROUP_PROP_LAST,
+				gr_properties);
 }
 
 GType

mercurial