[gnome-photos/wip/rishi/manager-model: 4/8] embed: Assert that we have an active item when entering PREVIEW



commit fcba651ccf76824cabf89c11e8de537606a160c4
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Dec 6 11:49:08 2016 +0100

    embed: Assert that we have an active item when entering PREVIEW

 src/photos-embed.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-embed.c b/src/photos-embed.c
index 1065523..878d5c7 100644
--- a/src/photos-embed.c
+++ b/src/photos-embed.c
@@ -32,6 +32,7 @@
 #include <gio/gio.h>
 #include <glib/gi18n.h>
 
+#include "photos-base-item.h"
 #include "photos-embed.h"
 #include "photos-filterable.h"
 #include "photos-item-manager.h"
@@ -249,11 +250,15 @@ static void
 photos_embed_prepare_for_preview (PhotosEmbed *self, PhotosWindowMode old_mode)
 {
   PhotosBaseItem *active_collection;
+  PhotosBaseItem *item;
 
   /* TODO: SearchController,
    *       ErrorHandler
    */
 
+  item = PHOTOS_BASE_ITEM (photos_base_manager_get_active_object (self->item_mngr));
+  g_return_if_fail (PHOTOS_IS_BASE_ITEM (item));
+
   /* We want to freeze before saving the search state and to thaw
    * after restoring it. We could thaw it earlier too, but that would
    * lead to a bunch of needless queries from the TrackerControllers.


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