[gnome-photos] preview-view: Use the right API to detect if a BaseItem is a collection
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] preview-view: Use the right API to detect if a BaseItem is a collection
- Date: Wed, 24 Aug 2016 15:48:45 +0000 (UTC)
commit 9f6b1e3a73c09d1d6d73e0f2a353d9ff5a9c4b4b
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Aug 24 16:21:01 2016 +0200
preview-view: Use the right API to detect if a BaseItem is a collection
Some collections might not have a nao:identifier. eg., the built-in
nfo:image-category-screenshot. This hasn't been a problem so far
because such collections do not (that's a bug) show up in search
results.
src/photos-preview-model.c | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
---
diff --git a/src/photos-preview-model.c b/src/photos-preview-model.c
index 7cecae5..2148951 100644
--- a/src/photos-preview-model.c
+++ b/src/photos-preview-model.c
@@ -26,7 +26,6 @@
#include "photos-base-item.h"
#include "photos-base-manager.h"
#include "photos-preview-model.h"
-#include "photos-query.h"
#include "photos-search-context.h"
#include "photos-view-model.h"
@@ -52,7 +51,6 @@ photos_preview_model_visible (GtkTreeModel *model, GtkTreeIter *iter, gpointer u
PhotosPreviewModel *self = PHOTOS_PREVIEW_MODEL (user_data);
PhotosBaseItem *item;
gboolean ret_val = FALSE;
- const gchar *identifier;
gchar *id;
gtk_tree_model_get (model, iter, PHOTOS_VIEW_MODEL_URN, &id, -1);
@@ -60,11 +58,7 @@ photos_preview_model_visible (GtkTreeModel *model, GtkTreeIter *iter, gpointer u
goto out;
item = PHOTOS_BASE_ITEM (photos_base_manager_get_object_by_id (self->item_mngr, id));
- identifier = photos_base_item_get_identifier (item);
- if (identifier != NULL && g_str_has_prefix (identifier, PHOTOS_QUERY_COLLECTIONS_IDENTIFIER))
- goto out;
-
- ret_val = TRUE;
+ ret_val = !photos_base_item_is_collection (item);
out:
g_free (id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]