summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Schwinn <alexxcons@xfce.org>2019-07-28 00:04:52 +0200
committerAlexander Schwinn <alexxcons@xfce.org>2019-08-09 21:37:00 +0200
commita1e894f7b072aa9b81f9c3ae538cb7e3ba1e440c (patch)
tree27555d1410dfa1816537b8c6cda3cdaa342a9f29
parent570eef5406d599f7c2966225e1f52981c68ad4aa (diff)
downloadthunar-a1e894f7b072aa9b81f9c3ae538cb7e3ba1e440c.tar.gz
Remove 'auto-expand folders' from tree-view since it causes bad usability with keyboard
(Bug #15743)
-rw-r--r--thunar/thunar-tree-view.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c
index 6a250505..f9e41b5a 100644
--- a/thunar/thunar-tree-view.c
+++ b/thunar/thunar-tree-view.c
@@ -2509,7 +2509,6 @@ thunar_tree_view_cursor_idle (gpointer user_data)
gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model), &iter, path);
gtk_tree_path_free (path);
- path = NULL;
/* collect all ThunarFiles in the path of current_directory in a List. root is on the very left side */
for (file = view->current_directory; file != NULL; file = thunar_file_get_parent (file, NULL))
@@ -2540,11 +2539,7 @@ thunar_tree_view_cursor_idle (gpointer user_data)
gtk_tree_model_get (GTK_TREE_MODEL (view->model), &iter, THUNAR_TREE_MODEL_COLUMN_FILE, &file_in_tree, -1);
if (file == file_in_tree)
{
- if (path != NULL)
- gtk_tree_path_free (path);
g_object_unref (file_in_tree);
- /* always remember latest known path, so we can set the cursor to it */
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->model), &iter);
break;
}
if (file_in_tree)
@@ -2557,6 +2552,9 @@ thunar_tree_view_cursor_idle (gpointer user_data)
/* 5. Did we already find the full path ?*/
if (lp->next == NULL)
{
+ path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->model), &iter);
+ gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE);
+ gtk_tree_path_free (path);
done = TRUE;
break;
}
@@ -2582,17 +2580,13 @@ thunar_tree_view_cursor_idle (gpointer user_data)
break; /* we dont have a valid child_iter by now, so we cannot continue. */
/* Since done is FALSE, the next iteration on thunar_tree_view_cursor_idle will go deeper */
}
- iter = child_iter; /* next tree level */
- }
- if (path == NULL)
- path = thunar_tree_view_get_preferred_toplevel_path (view, view->current_directory);
-
- if (path != NULL)
- {
+ /* expand path up to the current tree level */
+ path = gtk_tree_model_get_path (GTK_TREE_MODEL (view->model), &iter);
gtk_tree_view_expand_to_path (GTK_TREE_VIEW (view), path);
- gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE);
gtk_tree_path_free (path);
+
+ iter = child_iter; /* next tree level */
}
/* tidy up */