[gnome-photos] view-model: Skip collections in the overview
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] view-model: Skip collections in the overview
- Date: Wed, 9 Oct 2013 16:02:29 +0000 (UTC)
commit e4cfbd60338591769ce76b624d53aa98790f69ac
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Oct 9 17:49:58 2013 +0200
view-model: Skip collections in the overview
Fixes: https://bugzilla.gnome.org/709367
src/photos-view-model.c | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-view-model.c b/src/photos-view-model.c
index f1e3999..3f7d1d0 100644
--- a/src/photos-view-model.c
+++ b/src/photos-view-model.c
@@ -153,6 +153,16 @@ photos_view_model_info_updated (PhotosBaseItem *item, gpointer user_data)
else if (is_favorite && row_ref == NULL && collection == NULL)
photos_view_model_add_item (self, item);
}
+ else if (priv->mode == PHOTOS_WINDOW_MODE_OVERVIEW)
+ {
+ gboolean is_collection;
+
+ is_collection = photos_base_item_is_collection (item);
+ if (is_collection && row_ref != NULL)
+ photos_view_model_object_removed (self, G_OBJECT (item));
+ else if (!is_collection && row_ref == NULL)
+ photos_view_model_add_item (self, item);
+ }
row_ref = (GtkTreeRowReference *) g_object_get_data (G_OBJECT (item), priv->row_ref_key);
if (row_ref != NULL)
@@ -173,13 +183,18 @@ photos_view_model_object_added (PhotosViewModel *self, GObject *object)
PhotosBaseItem *item = PHOTOS_BASE_ITEM (object);
PhotosViewModelPrivate *priv = self->priv;
GObject *collection;
+ gboolean is_collection;
+ gboolean is_favorite;
collection = photos_base_manager_get_active_object (priv->col_mngr);
+ is_collection = photos_base_item_is_collection (item);
+ is_favorite = photos_base_item_is_favorite (item);
if (collection == NULL)
{
- if ((priv->mode == PHOTOS_WINDOW_MODE_COLLECTIONS && !photos_base_item_is_collection (item))
- || (priv->mode == PHOTOS_WINDOW_MODE_FAVORITES && !photos_base_item_is_favorite (item)))
+ if ((priv->mode == PHOTOS_WINDOW_MODE_COLLECTIONS && !is_collection)
+ || (priv->mode == PHOTOS_WINDOW_MODE_FAVORITES && !is_favorite)
+ || (priv->mode == PHOTOS_WINDOW_MODE_OVERVIEW && is_collection))
goto out;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]