[gnome-photos] item-manager: Use g_set_object to simplify activate_previous_collection



commit 4b87a59138b08409ff519042eff5f958a27b3446
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Aug 15 23:30:56 2016 +0200

    item-manager: Use g_set_object to simplify activate_previous_collection

 src/photos-item-manager.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index d943385..0bc80f9 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -580,11 +580,7 @@ photos_item_manager_activate_previous_collection (PhotosItemManager *self)
   collection = g_queue_pop_head (self->collection_path);
   g_assert (collection == NULL || PHOTOS_IS_BASE_ITEM (collection));
 
-  g_clear_object (&self->active_collection);
-
-  if (collection != NULL)
-    g_object_ref (collection);
-  self->active_collection = PHOTOS_BASE_ITEM (collection);
+  g_set_object (&self->active_collection, PHOTOS_BASE_ITEM (collection));
 
   PHOTOS_BASE_MANAGER_CLASS (photos_item_manager_parent_class)
     ->set_active_object (PHOTOS_BASE_MANAGER (self), (GObject *) collection);


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