summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtktreemodelsort.c13
-rw-r--r--gtk/gtktreeview.c13
2 files changed, 15 insertions, 11 deletions
diff --git a/gtk/gtktreemodelsort.c b/gtk/gtktreemodelsort.c
index 6fe97993d..565b15100 100644
--- a/gtk/gtktreemodelsort.c
+++ b/gtk/gtktreemodelsort.c
@@ -676,7 +676,7 @@ gtk_tree_model_sort_rows_reordered (GtkTreeModel *s_model,
SortLevel *level;
GtkTreeIter iter;
gint *tmp_array;
- int i;
+ int i, j;
GtkTreePath *path;
GtkTreeModelSort *tree_model_sort = GTK_TREE_MODEL_SORT (data);
@@ -716,11 +716,18 @@ gtk_tree_model_sort_rows_reordered (GtkTreeModel *s_model,
tmp_array = g_new (int, level->array->len);
for (i = 0; i < level->array->len; i++)
- tmp_array[new_order[i]] = g_array_index (level->array, SortElt, i).offset;
+ {
+ for (j = 0; j < level->array->len; j++)
+ {
+ if (g_array_index (level->array, SortElt, i).offset == new_order[j])
+ tmp_array[i] = j;
+ }
+ }
+
for (i = 0; i < level->array->len; i++)
g_array_index (level->array, SortElt, i).offset = tmp_array[i];
g_free (tmp_array);
-
+
if (tree_model_sort->sort_column_id == -1 &&
tree_model_sort->default_sort_func == (GtkTreeIterCompareFunc) 0x1)
{
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index c443407d2..2bdff6e04 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -806,14 +806,6 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS,
GTK_TYPE_INT, -1);
- gtk_binding_entry_add_signal (binding_set, GDK_Right, GDK_SHIFT_MASK, "move_cursor", 2,
- GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS,
- GTK_TYPE_INT, 1);
-
- gtk_binding_entry_add_signal (binding_set, GDK_Left, GDK_SHIFT_MASK, "move_cursor", 2,
- GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS,
- GTK_TYPE_INT, -1);
-
gtk_binding_entry_add_signal (binding_set, GDK_Right, GDK_CONTROL_MASK|GDK_SHIFT_MASK, "move_cursor", 2,
GTK_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS,
GTK_TYPE_INT, 1);
@@ -7586,6 +7578,8 @@ gtk_tree_view_real_expand_row (GtkTreeView *tree_view,
if (node->children)
return TRUE;
+ if (! GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_PARENT))
+ return FALSE;
gtk_tree_model_get_iter (tree_view->priv->model, &iter, path);
if (! gtk_tree_model_iter_has_child (tree_view->priv->model, &iter))
@@ -7690,6 +7684,9 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view,
gint x, y;
GList *list;
+ if (node->children == NULL)
+ return FALSE;
+
gtk_tree_model_get_iter (tree_view->priv->model, &iter, path);
g_signal_emit (G_OBJECT (tree_view), tree_view_signals[TEST_COLLAPSE_ROW], 0, &iter, path, &collapse);