[gnome-photos/wip/rishi/use-g-auto-00] organize-collection-model: Simplify code




commit 3039071b2ce6a7c1a42d8413db7d9aff2e8098e0
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Mar 27 16:59:17 2021 +0100

    organize-collection-model: Simplify code
    
    https://gitlab.gnome.org/GNOME/gnome-photos/-/merge_requests/201

 src/photos-organize-collection-model.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/photos-organize-collection-model.c b/src/photos-organize-collection-model.c
index aae3f95d..ee09bf5b 100644
--- a/src/photos-organize-collection-model.c
+++ b/src/photos-organize-collection-model.c
@@ -266,10 +266,7 @@ photos_organize_collection_model_get_placeholder (PhotosOrganizeCollectionModel
     ret_val = gtk_tree_row_reference_get_path (self->placeholder_ref);
 
   if (forget)
-    {
-      gtk_tree_row_reference_free (self->placeholder_ref);
-      self->placeholder_ref = NULL;
-    }
+    g_clear_pointer (&self->placeholder_ref, gtk_tree_row_reference_free);
 
   return ret_val;
 }
@@ -295,6 +292,5 @@ photos_organize_collection_model_remove_placeholder (PhotosOrganizeCollectionMod
   if (gtk_tree_model_get_iter (GTK_TREE_MODEL (self), &placeholder_iter, placeholder_path))
     gtk_list_store_remove (GTK_LIST_STORE (self), &placeholder_iter);
 
-  gtk_tree_row_reference_free (self->placeholder_ref);
-  self->placeholder_ref = NULL;
+  g_clear_pointer (&self->placeholder_ref, gtk_tree_row_reference_free);
 }


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