Mercurial > pidgin
comparison finch/libgnt/gnttree.c @ 18873:7066896f6628
disapproval of revision 'a4ce7b8adf2db74d531c35278fe83247d90ce4b1'
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sat, 11 Aug 2007 04:19:32 +0000 |
parents | 85b155a574a3 |
children | 4fd3547dd4ab |
comparison
equal
deleted
inserted
replaced
18872:85b155a574a3 | 18873:7066896f6628 |
---|---|
1484 GntTreeRow *row; | 1484 GntTreeRow *row; |
1485 GntTreeCol *col; | 1485 GntTreeCol *col; |
1486 | 1486 |
1487 g_return_if_fail(colno < tree->ncol); | 1487 g_return_if_fail(colno < tree->ncol); |
1488 | 1488 |
1489 text = gnt_util_localize_string(text); | |
1490 row = g_hash_table_lookup(tree->hash, key); | 1489 row = g_hash_table_lookup(tree->hash, key); |
1491 if (row) | 1490 if (row) |
1492 { | 1491 { |
1493 col = g_list_nth_data(row->columns, colno); | 1492 col = g_list_nth_data(row->columns, colno); |
1494 if (BINARY_DATA(tree, colno)) { | 1493 if (BINARY_DATA(tree, colno)) { |
1624 col->span = 1; | 1623 col->span = 1; |
1625 if (BINARY_DATA(tree, i)) { | 1624 if (BINARY_DATA(tree, i)) { |
1626 col->text = iter->data; | 1625 col->text = iter->data; |
1627 col->isbinary = TRUE; | 1626 col->isbinary = TRUE; |
1628 } else { | 1627 } else { |
1629 const char *text = iter->data; | 1628 col->text = g_strdup(iter->data ? iter->data : ""); |
1630 text = gnt_util_localize_string(text); | |
1631 col->text = g_strdup(text ? text : ""); | |
1632 col->isbinary = FALSE; | 1629 col->isbinary = FALSE; |
1633 } | 1630 } |
1634 | 1631 |
1635 row->columns = g_list_append(row->columns, col); | 1632 row->columns = g_list_append(row->columns, col); |
1636 } | 1633 } |
1668 } | 1665 } |
1669 | 1666 |
1670 void gnt_tree_set_column_title(GntTree *tree, int index, const char *title) | 1667 void gnt_tree_set_column_title(GntTree *tree, int index, const char *title) |
1671 { | 1668 { |
1672 g_free(tree->columns[index].title); | 1669 g_free(tree->columns[index].title); |
1673 title = gnt_util_localize_string(title); | |
1674 tree->columns[index].title = g_strdup(title); | 1670 tree->columns[index].title = g_strdup(title); |
1675 } | 1671 } |
1676 | 1672 |
1677 void gnt_tree_set_column_titles(GntTree *tree, ...) | 1673 void gnt_tree_set_column_titles(GntTree *tree, ...) |
1678 { | 1674 { |
1681 | 1677 |
1682 va_start(args, tree); | 1678 va_start(args, tree); |
1683 for (i = 0; i < tree->ncol; i++) | 1679 for (i = 0; i < tree->ncol; i++) |
1684 { | 1680 { |
1685 const char *title = va_arg(args, const char *); | 1681 const char *title = va_arg(args, const char *); |
1686 title = gnt_util_localize_string(title); | |
1687 tree->columns[i].title = g_strdup(title); | 1682 tree->columns[i].title = g_strdup(title); |
1688 } | 1683 } |
1689 va_end(args); | 1684 va_end(args); |
1690 } | 1685 } |
1691 | 1686 |