Commit fd30af9b authored by Theo Linkspfeifer's avatar Theo Linkspfeifer Committed by Alexander Schwinn

Move iter initialization (Bug #16024) - Fixes 100%CPU on tree-view in some rare cases

parent 3ebb1424
......@@ -2889,10 +2889,6 @@ thunar_tree_view_get_preferred_toplevel_path (ThunarTreeView *view,
_thunar_return_val_if_fail (THUNAR_IS_FILE (file), NULL);
/* check whether the root node is available */
if (!gtk_tree_model_get_iter_first (model, &iter))
return NULL;
/* get active toplevel path and check if we can use it */
gtk_tree_view_get_cursor (GTK_TREE_VIEW (view), &path, NULL);
if (path != NULL)
......@@ -2922,6 +2918,10 @@ thunar_tree_view_get_preferred_toplevel_path (ThunarTreeView *view,
path = NULL;
}
/* check whether the root node is available */
if (!gtk_tree_model_get_iter_first (model, &iter))
return NULL;
/* get GFiles for special toplevel items */
desktop = thunar_g_file_new_for_desktop ();
home = thunar_g_file_new_for_home ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment