libpurple/presence.c

branch
soc.2013.gobjectification.plugins
changeset 36872
c0099fc27ace
parent 36846
d6e55ebf2820
parent 35013
4718438d053b
child 36949
06cbd6ed97ed
--- a/libpurple/presence.c	Fri Oct 11 03:11:37 2013 +0530
+++ b/libpurple/presence.c	Fri Oct 11 15:54:01 2013 +0530
@@ -171,6 +171,8 @@
 		return;
 
 	priv->login_time = login_time;
+
+	g_object_notify(G_OBJECT(presence), "login-time");
 }
 
 GList *
@@ -321,13 +323,6 @@
  * GObject code for PurplePresence
  **************************************************************************/
 
-/* GObject Property names */
-#define PRES_PROP_IDLE_S           "idle"
-#define PRES_PROP_IDLE_TIME_S      "idle-time"
-#define PRES_PROP_LOGIN_TIME_S     "login-time"
-#define PRES_PROP_STATUSES_S       "statuses"
-#define PRES_PROP_ACTIVE_STATUS_S  "active-status"
-
 /* Set method for GObject properties */
 static void
 purple_presence_set_property(GObject *obj, guint param_id, const GValue *value,
@@ -462,7 +457,7 @@
 	obj_class->set_property = purple_presence_set_property;
 
 	g_object_class_install_property(obj_class, PRES_PROP_IDLE,
-			g_param_spec_boolean(PRES_PROP_IDLE_S, _("Idle"),
+			g_param_spec_boolean("idle", _("Idle"),
 				_("Whether the presence is in idle state."), FALSE,
 				G_PARAM_READWRITE)
 			);
@@ -476,7 +471,7 @@
 #else
 #error Unknown size of time_t
 #endif
-				(PRES_PROP_IDLE_TIME_S, _("Idle time"),
+				("idle-time", _("Idle time"),
 				_("The idle time of the presence"),
 #if SIZEOF_TIME_T == 4
 				G_MININT, G_MAXINT, 0,
@@ -496,7 +491,7 @@
 #else
 #error Unknown size of time_t
 #endif
-				(PRES_PROP_LOGIN_TIME_S, _("Login time"),
+				("login-time", _("Login time"),
 				_("The login time of the presence."),
 #if SIZEOF_TIME_T == 4
 				G_MININT, G_MAXINT, 0,
@@ -509,13 +504,13 @@
 			);
 
 	g_object_class_install_property(obj_class, PRES_PROP_STATUSES,
-			g_param_spec_pointer(PRES_PROP_STATUSES_S, _("Statuses"),
+			g_param_spec_pointer("statuses", _("Statuses"),
 				_("The list of statuses in the presence."),
 				G_PARAM_READABLE)
 			);
 
 	g_object_class_install_property(obj_class, PRES_PROP_ACTIVE_STATUS,
-			g_param_spec_object(PRES_PROP_ACTIVE_STATUS_S, _("Active status"),
+			g_param_spec_object("active-status", _("Active status"),
 				_("The active status for the presence."), PURPLE_TYPE_STATUS,
 				G_PARAM_READWRITE)
 			);
@@ -684,9 +679,6 @@
  * GObject code for PurpleAccountPresence
  **************************************************************************/
 
-/* GObject Property names */
-#define ACPRES_PROP_ACCOUNT_S  "account"
-
 /* Set method for GObject properties */
 static void
 purple_account_presence_set_property(GObject *obj, guint param_id, const GValue *value,
@@ -753,7 +745,7 @@
 	obj_class->set_property = purple_account_presence_set_property;
 
 	g_object_class_install_property(obj_class, ACPRES_PROP_ACCOUNT,
-			g_param_spec_object(ACPRES_PROP_ACCOUNT_S, _("Account"),
+			g_param_spec_object("account", _("Account"),
 				_("The account that this presence is of."), PURPLE_TYPE_ACCOUNT,
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)
 			);
@@ -794,7 +786,7 @@
 	g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL);
 
 	return g_object_new(PURPLE_TYPE_ACCOUNT_PRESENCE,
-			ACPRES_PROP_ACCOUNT_S, account,
+			"account", account,
 			NULL);
 }
 
@@ -879,9 +871,6 @@
  * GObject code for PurpleBuddyPresence
  **************************************************************************/
 
-/* GObject Property names */
-#define BUDPRES_PROP_BUDDY_S  "buddy"
-
 /* Set method for GObject properties */
 static void
 purple_buddy_presence_set_property(GObject *obj, guint param_id, const GValue *value,
@@ -950,7 +939,7 @@
 	obj_class->set_property = purple_buddy_presence_set_property;
 
 	g_object_class_install_property(obj_class, BUDPRES_PROP_BUDDY,
-			g_param_spec_object(BUDPRES_PROP_BUDDY_S, _("Buddy"),
+			g_param_spec_object("buddy", _("Buddy"),
 				_("The buddy that this presence is of."), PURPLE_TYPE_BUDDY,
 				G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)
 			);
@@ -991,6 +980,6 @@
 	g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL);
 
 	return g_object_new(PURPLE_TYPE_BUDDY_PRESENCE,
-			BUDPRES_PROP_BUDDY_S, buddy,
+			"buddy", buddy,
 			NULL);
 }

mercurial