[gtk/gbsneto/filechooser-column-view: 126/161] filesystemmodel: Trivial cleanup




commit 8a799d13250f5d54f9d932fc44d377632a68c7fc
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sun Oct 9 18:49:37 2022 -0300

    filesystemmodel: Trivial cleanup
    
    Use g_set_object() which does exactly what the code there does.

 gtk/gtkfilesystemmodel.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index 79ef17770d..06fa65808a 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -1700,7 +1700,6 @@ _gtk_file_system_model_update_file (GtkFileSystemModel *model,
 {
   FileModelNode *node;
   guint i, id;
-  GFileInfo *old_info;
 
   g_return_if_fail (GTK_IS_FILE_SYSTEM_MODEL (model));
   g_return_if_fail (G_IS_FILE (file));
@@ -1715,10 +1714,7 @@ _gtk_file_system_model_update_file (GtkFileSystemModel *model,
 
   node = get_node (model, id);
 
-  old_info = node->info;
-  node->info = g_object_ref (info);
-  if (old_info)
-    g_object_unref (old_info);
+  g_set_object (&node->info, info);
 
   for (i = 0; i < model->n_columns; i++)
     {


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