Пример #1
0
/**
 * Free linked list of attributes; both attributes and the list are freed.
 * It is assumed that attributes are *NOT* contained within some other
 * container.
 * \param list List of attributes to be freed.
 */
void addritem_free_list_attribute( GList *list ) {
	GList *node = list;
	while( node ) {
		addritem_free_attribute( node->data );
		node->data = NULL;
		node = g_list_next( node );
	}
	g_list_free( list );
}
Пример #2
0
/**
 * Free linked lists of character strings.
 * \param listName  List of common names.
 * \param listAddr  List of addresses.
 * \param listFirst List of first names.
 * \param listLast  List of last names.
 */
static void ldapqry_free_lists(
		GSList *listName, GSList *listAddr, GSList *listFirst,
		GSList *listLast, GSList *listDisplay, GSList *other_attrs )
{
	GSList *cur = other_attrs;
	mgu_free_list( listName );
	mgu_free_list( listAddr );
	mgu_free_list( listFirst );
	mgu_free_list( listLast );
	mgu_free_list( listDisplay );
	for(;cur; cur = cur->next)
		addritem_free_attribute((UserAttribute *)cur->data);
	g_slist_free(other_attrs);
}
static void edit_person_attrib_delete(gpointer data) {
	GtkCMCList *clist = GTK_CMCLIST(personEditDlg->clist_attrib);
	gint row = personEditDlg->rowIndAttrib;
	UserAttribute *attrib = gtk_cmclist_get_row_data(clist, row);
	edit_person_attrib_clear(NULL);
	if (attrib) {
		/* Remove list entry */
		gtk_cmclist_remove(clist, row);
		addritem_free_attribute(attrib);
		attrib = NULL;
	}

	/* Position hilite bar */
	attrib = gtk_cmclist_get_row_data(clist, row);
	if (!attrib) {
		personEditDlg->rowIndAttrib = -1 + row;
	} 
	
	if (!personEditDlg->read_only)
		gtk_widget_set_sensitive(personEditDlg->attrib_del, gtk_cmclist_get_row_data(clist, 0) != NULL);
	
	edit_person_status_show(NULL);
}