mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
use gtk_tree_view_get_n_columns
instead of g_list_length (gtk_tree_view_get_columns (tree))
This commit is contained in:
parent
4bb16f03a5
commit
4eec093acc
@ -2154,13 +2154,7 @@ gint
|
||||
gnc_tree_view_append_column (GncTreeView *view,
|
||||
GtkTreeViewColumn *column)
|
||||
{
|
||||
GList *columns;
|
||||
int n;
|
||||
|
||||
/* There's no easy way to get this number. */
|
||||
columns = gtk_tree_view_get_columns (GTK_TREE_VIEW(view));
|
||||
n = g_list_length (columns);
|
||||
g_list_free (columns);
|
||||
int n = gtk_tree_view_get_n_columns (GTK_TREE_VIEW(view));
|
||||
|
||||
/* Ignore the initial column, the selection menu */
|
||||
if (n >= 1)
|
||||
@ -2177,7 +2171,7 @@ get_column_next_to (GtkTreeView *tv, GtkTreeViewColumn **col, gboolean backward)
|
||||
gboolean wrapped = FALSE;
|
||||
|
||||
cols = gtk_tree_view_get_columns (tv);
|
||||
g_return_val_if_fail (g_list_length (cols) > 0, FALSE);
|
||||
g_return_val_if_fail (cols != NULL, FALSE);
|
||||
|
||||
node = g_list_find (cols, *col);
|
||||
g_return_val_if_fail (node, FALSE);
|
||||
|
@ -1646,9 +1646,7 @@ void CsvImpPriceAssist::preview_refresh_table ()
|
||||
|
||||
/* Start with counting the current number of columns (ntcols)
|
||||
* we have in the treeview */
|
||||
auto columns = gtk_tree_view_get_columns (treeview);
|
||||
auto ntcols = g_list_length(columns);
|
||||
g_list_free (columns);
|
||||
auto ntcols = gtk_tree_view_get_n_columns (treeview);
|
||||
|
||||
/* Drop redundant columns if the model has less data columns than the new model
|
||||
* ntcols = n° of columns in treeview (1 error column + x data columns)
|
||||
|
@ -1572,9 +1572,7 @@ void CsvImpTransAssist::preview_refresh_table ()
|
||||
|
||||
/* Start with counting the current number of columns (ntcols)
|
||||
* we have in the treeview */
|
||||
auto columns = gtk_tree_view_get_columns (treeview);
|
||||
auto ntcols = g_list_length(columns);
|
||||
g_list_free (columns);
|
||||
auto ntcols = gtk_tree_view_get_n_columns (treeview);
|
||||
|
||||
/* Drop redundant columns if the model has less data columns than the new model
|
||||
* ntcols = n° of columns in treeview (1 error column + x data columns)
|
||||
|
Loading…
Reference in New Issue
Block a user