[nautilus] grid-cell: Fix leak and use macros



commit 524ea6cac4b60cc1b81c675bfbb579ccc2d58c34
Author: Ignacy Kuchciński <ignacykuchcinski gmail com>
Date:   Sun Aug 21 20:06:14 2022 +0200

    grid-cell: Fix leak and use macros

 src/nautilus-grid-cell.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-grid-cell.c b/src/nautilus-grid-cell.c
index 4ed8455fb..443e0df86 100644
--- a/src/nautilus-grid-cell.c
+++ b/src/nautilus-grid-cell.c
@@ -126,6 +126,7 @@ on_file_changed (NautilusGridCell *self)
 {
     NautilusViewItem *item;
     NautilusFile *file;
+    g_autofree gchar *name = NULL;
 
     item = nautilus_view_cell_get_item (NAUTILUS_VIEW_CELL (self));
     g_return_if_fail (item != NULL);
@@ -134,8 +135,9 @@ on_file_changed (NautilusGridCell *self)
     update_icon (self);
     update_emblems (self);
 
-    gtk_label_set_text (GTK_LABEL (self->label),
-                        nautilus_file_get_display_name (file));
+    name = nautilus_file_get_display_name (file);
+
+    gtk_label_set_text (GTK_LABEL (self->label), name);
     update_captions (self);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]