[nautilus/105-expanding-folders-crashes-nautilus] If org.gnome.nautilus.list-view use-tree-view is TRUE, folders can be expanded, which creates a dumm
- From: Gitlab Administrative User <gitlab src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/105-expanding-folders-crashes-nautilus] If org.gnome.nautilus.list-view use-tree-view is TRUE, folders can be expanded, which creates a dumm
- Date: Tue, 7 Nov 2017 15:27:20 +0000 (UTC)
commit b1b408fddebae5726016bca261c9b8752e7441a6
Author: António Fernandes <antoniojpfernandes gmail com>
Date: Tue Nov 7 15:26:54 2017 +0000
If org.gnome.nautilus.list-view use-tree-view is TRUE, folders can
be expanded, which creates a dummy row to display the "Loading" label.
The code to display the correct star icon assumes each row represents a
file, but the dummy row breaks this assumption, crashing nautilus when
checking if the NULL file is starred or unstarred.
Instead, don't set a star icon unless the row represents a file. Also,
do nothing if the cell is clicked on a dummy row.
Fixes: #105
src/nautilus-list-view.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 1de1b4b6a..c284a675a 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -519,6 +519,13 @@ on_star_cell_renderer_clicked (GtkTreePath *path,
list_model = list_view->details->model;
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);
selection = g_list_prepend (NULL, file);
@@ -1677,6 +1684,16 @@ favorite_cell_data_func (GtkTreeViewColumn *column,
NAUTILUS_LIST_MODEL_FILE_COLUMN, &file,
-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);
if (nautilus_tag_manager_file_is_favorite (view->details->tag_manager, uri))
@@ -2194,7 +2211,6 @@ create_and_set_up_tree_view (NautilusListView *view)
{
cell = gtk_cell_renderer_pixbuf_new ();
g_object_set (cell,
- "icon-name", "non-starred-symbolic",
"mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE,
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]