pidgin: 68526fa8: Get rid of the wholly unused "primary at...

markdoliner at pidgin.im markdoliner at pidgin.im
Sat Aug 20 21:40:44 EDT 2011


----------------------------------------------------------------------
Revision: 68526fa8c5358c063c7999b1813f097fb571e42e
Parent:   a4f916c911e0fc63eecf8cda46168cd60344e322
Author:   markdoliner at pidgin.im
Date:     08/20/11 21:35:54
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/68526fa8c5358c063c7999b1813f097fb571e42e

Changelog: 

Get rid of the wholly unused "primary attribute" thing in PurpleStatusTypes

Changes against parent a4f916c911e0fc63eecf8cda46168cd60344e322

  patched  ChangeLog.API
  patched  libpurple/plugins/perl/common/Status.xs
  patched  libpurple/plugins/tcl/tcl_cmds.c
  patched  libpurple/status.c
  patched  libpurple/status.h

-------------- next part --------------
============================================================
--- libpurple/status.c	1fe615918cf2ee8aebf62008f21b0b5b7aa834ae
+++ libpurple/status.c	6fef128edcbdfb94c015322f552eb258654a742f
@@ -44,7 +44,6 @@ struct _PurpleStatusType
 
 	char *id;
 	char *name;
-	char *primary_attr_id;
 
 	gboolean saveable;
 	gboolean user_settable;
@@ -294,7 +293,6 @@ purple_status_type_destroy(PurpleStatusT
 
 	g_free(status_type->id);
 	g_free(status_type->name);
-	g_free(status_type->primary_attr_id);
 
 	g_list_foreach(status_type->attrs, (GFunc)purple_status_attr_destroy, NULL);
 	g_list_free(status_type->attrs);
@@ -304,15 +302,6 @@ void
 }
 
 void
-purple_status_type_set_primary_attr(PurpleStatusType *status_type, const char *id)
-{
-	g_return_if_fail(status_type != NULL);
-
-	g_free(status_type->primary_attr_id);
-	status_type->primary_attr_id = g_strdup(id);
-}
-
-void
 purple_status_type_add_attr(PurpleStatusType *status_type, const char *id,
 		const char *name, PurpleValue *value)
 {
@@ -435,14 +424,6 @@ purple_status_type_is_available(const Pu
 	return (primitive == PURPLE_STATUS_AVAILABLE);
 }
 
-const char *
-purple_status_type_get_primary_attr(const PurpleStatusType *status_type)
-{
-	g_return_val_if_fail(status_type != NULL, NULL);
-
-	return status_type->primary_attr_id;
-}
-
 PurpleStatusAttr *
 purple_status_type_get_attr(const PurpleStatusType *status_type, const char *id)
 {
============================================================
--- libpurple/status.h	3d1210c1a6387d5b8da5c48dbdac45f27c4c4696
+++ libpurple/status.h	c862eafdce07416ff396a871b201a914d48c7a2f
@@ -273,23 +273,6 @@ void purple_status_type_destroy(PurpleSt
 
 #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_STATUS_C_)
 /**
- * Sets a status type's primary attribute.
- *
- * The value for the primary attribute is used as the description for
- * the particular status type. An example is an away message. The message
- * would be the primary attribute.
- *
- * @param status_type The status type.
- * @param attr_id     The ID of the primary attribute.
- *
- * @deprecated This function isn't used and should be removed in 3.0.0.
- */
-void purple_status_type_set_primary_attr(PurpleStatusType *status_type,
-									   const char *attr_id);
-#endif
-
-#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_STATUS_C_)
-/**
  * Adds an attribute to a status type.
  *
  * @param status_type The status type to add the attribute to.
@@ -419,20 +402,7 @@ gboolean purple_status_type_is_available
  */
 gboolean purple_status_type_is_available(const PurpleStatusType *status_type);
 
-#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_STATUS_C_)
 /**
- * Returns a status type's primary attribute ID.
- *
- * @param type The status type.
- *
- * @return The primary attribute's ID.
- *
- * @deprecated This function isn't used and should be removed in 3.0.0.
- */
-const char *purple_status_type_get_primary_attr(const PurpleStatusType *type);
-#endif
-
-/**
  * Returns the attribute with the specified ID.
  *
  * @param status_type The status type containing the attribute.
============================================================
--- libpurple/plugins/tcl/tcl_cmds.c	5d493cf77398e177afbd7409338d3eb172cb6b7a
+++ libpurple/plugins/tcl/tcl_cmds.c	064f4d159937b49d0223c9ed24d0d44c19273c5a
@@ -1640,13 +1640,13 @@ int tcl_cmd_status_type(ClientData unuse
 int tcl_cmd_status_type(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 {
 	const char *cmds[] = { "attr", "attrs", "available", "exclusive", "id",
-	                       "independent", "name", "primary_attr",
+	                       "independent", "name",
 	                       "primitive", "saveable", "user_settable",
 	                       NULL };
 	enum { CMD_STATUS_TYPE_ATTR, CMD_STATUS_TYPE_ATTRS,
 	       CMD_STATUS_TYPE_AVAILABLE, CMD_STATUS_TYPE_EXCLUSIVE,
 	       CMD_STATUS_TYPE_ID, CMD_STATUS_TYPE_INDEPENDENT,
-	       CMD_STATUS_TYPE_NAME, CMD_STATUS_TYPE_PRIMARY_ATTR,
+	       CMD_STATUS_TYPE_NAME,
 	       CMD_STATUS_TYPE_PRIMITIVE, CMD_STATUS_TYPE_SAVEABLE,
 	       CMD_STATUS_TYPE_USER_SETTABLE } cmd;
 	PurpleStatusType *status_type;
@@ -1751,18 +1751,6 @@ int tcl_cmd_status_type(ClientData unuse
 				 Tcl_NewStringObj(purple_primitive_get_id_from_type
 						  (purple_status_type_get_primitive(status_type)), -1));
 		break;
-	case CMD_STATUS_TYPE_PRIMARY_ATTR:
-#if !(defined PURPLE_DISABLE_DEPRECATED)
-		if (objc != 3) {
-			Tcl_WrongNumArgs(interp, 2, objv, "statustype");
-			return TCL_ERROR;
-		}
-		if ((status_type = purple_tcl_ref_get(interp, objv[2], PurpleTclRefStatusType)) == NULL)
-			return TCL_ERROR;
-		Tcl_SetObjResult(interp,
-				 Tcl_NewStringObj(purple_status_type_get_primary_attr(status_type), -1));
-#endif
-		break;
 	case CMD_STATUS_TYPE_SAVEABLE:
 		if (objc != 3) {
 			Tcl_WrongNumArgs(interp, 2, objv, "statustype");
============================================================
--- ChangeLog.API	d103d563613b16813700d29d3f54e9549d6d9ef6
+++ ChangeLog.API	eac26f0a8103f5ea435fb9451abc94c3a9c840e7
@@ -14,6 +14,8 @@ version 3.0.0 (??/??/????):
 		* purple_notify_searchresults_get_columns_count
 		* purple_notify_searchresults_get_rows_count
 		* purple_notify_searchresults_row_get
+		* purple_status_type_get_primary_attr
+		* purple_status_type_set_primary_attr
 		* purple_strlcat
 		* purple_strlcpy
 
============================================================
--- libpurple/plugins/perl/common/Status.xs	a1069ef638959f77af08e9695a8f90af9a25fe6e
+++ libpurple/plugins/perl/common/Status.xs	69fa64a67143cf1ee01709ebe65f3a3a169d8269
@@ -397,10 +397,6 @@ purple_status_type_get_name(status_type)
 purple_status_type_get_name(status_type)
 	Purple::StatusType status_type
 
-const char *
-purple_status_type_get_primary_attr(status_type)
-	Purple::StatusType status_type
-
 Purple::StatusPrimitive
 purple_status_type_get_primitive(status_type)
 	Purple::StatusType status_type
@@ -440,8 +436,3 @@ purple_status_type_new_full(primitive, i
 	gboolean saveable
 	gboolean user_settable
 	gboolean independent
-
-void
-purple_status_type_set_primary_attr(status_type, attr_id)
-	Purple::StatusType status_type
-	const char *attr_id


More information about the Commits mailing list