# HG changeset patch # User Sadrul Habib Chowdhury # Date 1184179074 0 # Node ID 8af9ebae439c3341e90bfdaeee0ac38fbb4a3888 # Parent 400f322a4da92ab4c720558da5540df1bb565368 Add purple_prefs_get_children_names in purple. And update Changelog.API diff -r 400f322a4da9 -r 8af9ebae439c ChangeLog.API --- a/ChangeLog.API Wed Jul 11 17:45:41 2007 +0000 +++ b/ChangeLog.API Wed Jul 11 18:37:54 2007 +0000 @@ -28,6 +28,7 @@ longer than 1 second away. Be aware of the rounding, though. * purple_xfer_get_remote_user * purple_pounces_get_all_for_ui + * purple_prefs_get_children_names Changed: * The documentation of the following functions now properly @@ -104,6 +105,8 @@ * gnt_window_present * gnt_tree_set_column_width_ratio * gnt_tree_set_column_resizable + * gnt_tree_set_column_is_right_aligned + * 'file-selected' signal is emited for GntFileSel Changed: * gnt_tree_get_rows() now returns a GList* instead of a const diff -r 400f322a4da9 -r 8af9ebae439c libpurple/prefs.c --- a/libpurple/prefs.c Wed Jul 11 17:45:41 2007 +0000 +++ b/libpurple/prefs.c Wed Jul 11 18:37:54 2007 +0000 @@ -1325,6 +1325,22 @@ disco_callback_helper_handle(&prefs, handle); } +GList * +purple_prefs_get_children_names(const char *name) +{ + GList * list = NULL; + struct purple_pref *pref = find_pref(name), *child; + + if (pref == NULL) + return NULL; + + for (child = pref->first_child; child; child = child->sibling) { + list = g_list_append(list, g_strdup(child->name)); + } + return list; + +} + void purple_prefs_update_old() { diff -r 400f322a4da9 -r 8af9ebae439c libpurple/prefs.h --- a/libpurple/prefs.h Wed Jul 11 17:45:41 2007 +0000 +++ b/libpurple/prefs.h Wed Jul 11 18:37:54 2007 +0000 @@ -281,6 +281,15 @@ */ GList *purple_prefs_get_path_list(const char *name); +/* + * Returns a list of children for a pref + * + * @param name The parent pref + * @return A list of newly allocated strings denoting the names of the children. + * Returns @c NULL if there are no children or if pref doesn't exist. + * The caller must free all the strings and the list. + */ +GList *purple_prefs_get_children_names(const char *name); /** * Add a callback to a pref (and its children)