Merge branch '105-expanding-folders-crashes-nautilus' into 'master'

Resolve "Expanding folders crashes nautilus"

Closes #105

See merge request GNOME/nautilus!24
This commit is contained in:
António Fernandes 2017-11-08 14:11:28 +00:00
commit 96e860696e

View file

@ -519,6 +519,13 @@ on_star_cell_renderer_clicked (GtkTreePath *path,
list_model = list_view->details->model; list_model = list_view->details->model;
file = nautilus_list_model_file_for_path (list_model, path); file = nautilus_list_model_file_for_path (list_model, path);
if (file == NULL)
{
/* This row is a label, not a file */
return;
}
uri = nautilus_file_get_uri (file); uri = nautilus_file_get_uri (file);
selection = g_list_prepend (NULL, file); selection = g_list_prepend (NULL, file);
@ -1677,6 +1684,16 @@ favorite_cell_data_func (GtkTreeViewColumn *column,
NAUTILUS_LIST_MODEL_FILE_COLUMN, &file, NAUTILUS_LIST_MODEL_FILE_COLUMN, &file,
-1); -1);
if (file == NULL)
{
/* This row is a label, not a file */
g_object_set (renderer,
"icon-name", NULL,
"mode", GTK_CELL_RENDERER_MODE_INERT,
NULL);
return;
}
uri = nautilus_file_get_uri (file); uri = nautilus_file_get_uri (file);
if (nautilus_tag_manager_file_is_favorite (view->details->tag_manager, uri)) if (nautilus_tag_manager_file_is_favorite (view->details->tag_manager, uri))
@ -2197,7 +2214,6 @@ create_and_set_up_tree_view (NautilusListView *view)
{ {
cell = gtk_cell_renderer_pixbuf_new (); cell = gtk_cell_renderer_pixbuf_new ();
g_object_set (cell, g_object_set (cell,
"icon-name", "non-starred-symbolic",
"mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE,
NULL); NULL);