Mercurial > pidgin
comparison console/libgnt/gnttree.c @ 15158:68385f5bbd61
[gaim-migrate @ 17944]
Generate the marshal-things during make when necessary.
Allow specifying the hash-functions for a GntTree.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sun, 10 Dec 2006 09:26:44 +0000 |
parents | 34e049e6ce10 |
children | c6b79e535eb8 |
comparison
equal
deleted
inserted
replaced
15157:67ccc195074b | 15158:68385f5bbd61 |
---|---|
1003 if (pr == NULL) | 1003 if (pr == NULL) |
1004 { | 1004 { |
1005 GntTreeRow *r = tree->root; | 1005 GntTreeRow *r = tree->root; |
1006 row->next = r; | 1006 row->next = r; |
1007 if (r) r->prev = row; | 1007 if (r) r->prev = row; |
1008 if (tree->current == tree->root) | |
1009 tree->current = row; | |
1008 tree->root = row; | 1010 tree->root = row; |
1009 tree->list = g_list_prepend(tree->list, key); | 1011 tree->list = g_list_prepend(tree->list, key); |
1010 } | 1012 } |
1011 else | 1013 else |
1012 { | 1014 { |
1144 } | 1146 } |
1145 | 1147 |
1146 void gnt_tree_remove_all(GntTree *tree) | 1148 void gnt_tree_remove_all(GntTree *tree) |
1147 { | 1149 { |
1148 tree->root = NULL; | 1150 tree->root = NULL; |
1149 g_hash_table_foreach_remove(tree->hash, (GHRFunc)return_true, NULL); | 1151 g_hash_table_foreach_remove(tree->hash, (GHRFunc)return_true, tree); |
1150 g_list_free(tree->list); | 1152 g_list_free(tree->list); |
1151 tree->list = NULL; | 1153 tree->list = NULL; |
1152 tree->current = tree->top = tree->bottom = NULL; | 1154 tree->current = tree->top = tree->bottom = NULL; |
1153 } | 1155 } |
1154 | 1156 |
1392 | 1394 |
1393 gnt_widget_get_size(GNT_WIDGET(tree), NULL, &height); | 1395 gnt_widget_get_size(GNT_WIDGET(tree), NULL, &height); |
1394 gnt_widget_set_size(GNT_WIDGET(tree), twidth, height); | 1396 gnt_widget_set_size(GNT_WIDGET(tree), twidth, height); |
1395 } | 1397 } |
1396 | 1398 |
1399 void gnt_tree_set_hash_fns(GntTree *tree, gpointer hash, gpointer eq, gpointer kd) | |
1400 { | |
1401 g_hash_table_foreach_remove(tree->hash, return_true, NULL); | |
1402 g_hash_table_destroy(tree->hash); | |
1403 tree->hash = g_hash_table_new_full(hash, eq, kd, free_tree_row); | |
1404 } | |
1405 |