changeset 15266:c95a05393dc3

[gaim-migrate @ 18056] Fix a problem with [18053] and add gaim_notify_user_info_remove_entry() committer: Tailor Script <tailor@pidgin.im>
author Evan Schoenberg <evan.s@dreskin.net>
date Tue, 26 Dec 2006 03:15:08 +0000
parents faa6afdcea39
children 6388c384bfac
files libgaim/notify.c libgaim/notify.h
diffstat 2 files changed, 22 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libgaim/notify.c	Tue Dec 26 02:47:13 2006 +0000
+++ b/libgaim/notify.c	Tue Dec 26 03:15:08 2006 +0000
@@ -475,7 +475,7 @@
 	return NULL;
 }
 
-static GaimNotifyUserInfoEntry *
+GaimNotifyUserInfoEntry *
 gaim_notify_user_info_entry_new(const char *label, const char *value)
 {
 	GaimNotifyUserInfoEntry *user_info_entry;
@@ -621,7 +621,7 @@
 }
 
 void
-gaim_notify_user_info_entry_set_value(GaimNotifyUserInfoEntry *user_info_entry, GaimNotifyUserInfoEntryType type)
+gaim_notify_user_info_entry_set_type(GaimNotifyUserInfoEntry *user_info_entry, GaimNotifyUserInfoEntryType type)
 {
 	g_return_if_fail(user_info_entry != NULL);
 
@@ -647,6 +647,15 @@
 }
 
 void
+gaim_notify_user_info_remove_entry(GaimNotifyUserInfo *user_info, GaimNotifyUserInfoEntry *user_info_entry)
+{
+	g_return_if_fail(user_info != NULL);
+	g_return_if_fail(user_info_entry != NULL);
+
+	user_info->user_info_entries = g_list_remove(user_info->user_info_entries, entry);
+}
+
+void
 gaim_notify_user_info_add_section_header(GaimNotifyUserInfo *user_info, const char *label)
 {
 	GaimNotifyUserInfoEntry *entry;
--- a/libgaim/notify.h	Tue Dec 26 02:47:13 2006 +0000
+++ b/libgaim/notify.h	Tue Dec 26 03:15:08 2006 +0000
@@ -448,6 +448,8 @@
  * GaimNotifyUserInfoEntry are allowed in the list.  If a GaimNotifyUserInfoEntry item is added to the list,
  * it should not be g_free()'d by the caller; GaimNotifyUserInfo will g_free it when destroyed.
  *
+ * To remove a GaimNotifyUserInfoEntry, use gaim_notify_user_info_remove_entry(). Do not use the GList directly.
+ *
  * @param user_info          The GaimNotifyUserInfo
  *
  * @result                   A GList of GaimNotifyUserInfoEntry objects
@@ -463,7 +465,8 @@
 char *gaim_notify_user_info_get_text_with_newline(GaimNotifyUserInfo *user_info, const char *newline);
 
 /**
- * Add a label/value pair to a GaimNotifyUserInfo object.  GaimNotifyUserInfo keeps track of the order in which pairs are added.
+ * Add a label/value pair to a GaimNotifyUserInfo object.
+ * GaimNotifyUserInfo keeps track of the order in which pairs are added.
  *
  * @param user_info          The GaimNotifyUserInfo
  * @param label              A label, which for example might be displayed by a UI with a colon after it ("Status:"). Do not include a colon.
@@ -487,6 +490,13 @@
 void gaim_notify_user_info_prepend_pair(GaimNotifyUserInfo *user_info, const char *label, const char *value);
 
 /**
+ * Remove a GaimNotifyUserInfoEntry from a GaimNotifyUserInfo object
+ *
+ * @param user_info          The GaimNotifyUserInfo
+ * @param user_info_entry    The GaimNotifyUserInfoEntry
+ */
+void gaim_notify_user_info_remove_entry(GaimNotifyUserInfo *user_info, GaimNotifyUserInfoEntry *user_info_entry);
+/**
  * Create a new GaimNotifyUserInfoEntry
  *
  * If added to a GaimNotifyUserInfo object, this should not be free()'d, as GaimNotifyUserInfo will do so