diff options
author | Federico Mena Quintero <federico@novell.com> | 2009-09-04 13:06:54 -0500 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2009-10-15 22:06:17 +0200 |
commit | 5ea265ca61d53e2c8daf13dc4b9a1dac4f4a69fc (patch) | |
tree | a59ea152594d87a10acd60f3f15570450996e551 /gtk/gtkfilesystemmodel.c | |
parent | 7ecc87ed5928c194b9e2fd3f9fa0efc9cc6fbe38 (diff) | |
download | gtk+-5ea265ca61d53e2c8daf13dc4b9a1dac4f4a69fc.tar.gz |
Clarify variable names in gtk_file_system_model_sort()
To comply with the i -> indexes; r -> rows convention.
Signed-off-by: Federico Mena Quintero <federico@novell.com>
Diffstat (limited to 'gtk/gtkfilesystemmodel.c')
-rw-r--r-- | gtk/gtkfilesystemmodel.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index e2811fc4a0..0e8345fa38 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -713,38 +713,39 @@ gtk_file_system_model_sort (GtkFileSystemModel *model) if (sort_data_init (&data, model)) { GtkTreePath *path; - guint i, j, n_elements; + guint i; + guint r, n_visible_rows; node_validate_rows (model, G_MAXUINT, G_MAXUINT); - n_elements = node_get_tree_row (model, model->files->len - 1) + 1; + n_visible_rows = node_get_tree_row (model, model->files->len - 1) + 1; model->n_nodes_valid = 0; g_hash_table_remove_all (model->file_lookup); - g_qsort_with_data (get_node (model, 1), + g_qsort_with_data (get_node (model, 1), /* start at index 1; don't sort the editable row */ model->files->len - 1, model->node_size, compare_array_element, &data); g_assert (model->n_nodes_valid == 0); g_assert (g_hash_table_size (model->file_lookup) == 0); - if (n_elements) + if (n_visible_rows) { - int *new_order = g_new (int, n_elements); + int *new_order = g_new (int, n_visible_rows); - j = 0; + r = 0; for (i = 0; i < model->files->len; i++) { FileModelNode *node = get_node (model, i); if (!node->visible) { - node->row = j; + node->row = r; continue; } - new_order[j] = node->row; - j++; - node->row = j; + new_order[r] = node->row; + r++; + node->row = r; } - g_assert (j == n_elements); + g_assert (r == n_visible_rows); path = gtk_tree_path_new (); gtk_tree_model_rows_reordered (GTK_TREE_MODEL (model), path, |