[gnome-photos] organize-collection-view: Don't mark local collections as remote



commit 2ef17de0bb9f54b3df12d8c59c1b673f0c3d2d9e
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Jul 2 14:44:18 2016 +0200

    organize-collection-view: Don't mark local collections as remote
    
    We should hide the details cell renderer if we failed to find the
    collection or if it is local. We were only hiding it in the first case.
    It meant that if a remote collection was followed by a local one, then
    the remote's source name would leak into the local collection's row.
    
    Fall out from e8cd66f34e36660a797f347946bd43fc4472bbe5
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768500

 src/photos-organize-collection-view.c |   28 +++++++++++++---------------
 1 files changed, 13 insertions(+), 15 deletions(-)
---
diff --git a/src/photos-organize-collection-view.c b/src/photos-organize-collection-view.c
index 91337e7..0ac3937 100644
--- a/src/photos-organize-collection-view.c
+++ b/src/photos-organize-collection-view.c
@@ -175,28 +175,26 @@ photos_organize_collection_view_detail_cell (GtkTreeViewColumn *tree_column,
   PhotosOrganizeCollectionView *self = PHOTOS_ORGANIZE_COLLECTION_VIEW (user_data);
   PhotosOrganizeCollectionViewPrivate *priv = self->priv;
   GObject *object;
+  const gchar *identifier = NULL;
   gchar *id;
 
   gtk_tree_model_get (GTK_TREE_MODEL (priv->model), iter, PHOTOS_ORGANIZE_MODEL_ID, &id, -1);
   object = photos_base_manager_get_object_by_id (priv->item_mngr, id);
 
   if (object != NULL)
-    {
-      const gchar *identifier;
+    identifier = photos_base_item_get_identifier (PHOTOS_BASE_ITEM (object));
 
-      identifier = photos_base_item_get_identifier (PHOTOS_BASE_ITEM (object));
-      if (identifier != NULL && !g_str_has_prefix (identifier, PHOTOS_QUERY_LOCAL_COLLECTIONS_IDENTIFIER))
-        {
-          PhotosSource *source;
-          const gchar *name;
-          const gchar *resource_urn;
-
-          resource_urn = photos_base_item_get_resource_urn (PHOTOS_BASE_ITEM (object));
-          source = PHOTOS_SOURCE (photos_base_manager_get_object_by_id (priv->src_mngr, resource_urn));
-          name = photos_source_get_name (source);
-          g_object_set (cell_renderer, "text", name, NULL);
-          gtk_cell_renderer_set_visible (cell_renderer, TRUE);
-        }
+  if (identifier != NULL && !g_str_has_prefix (identifier, PHOTOS_QUERY_LOCAL_COLLECTIONS_IDENTIFIER))
+    {
+      PhotosSource *source;
+      const gchar *name;
+      const gchar *resource_urn;
+
+      resource_urn = photos_base_item_get_resource_urn (PHOTOS_BASE_ITEM (object));
+      source = PHOTOS_SOURCE (photos_base_manager_get_object_by_id (priv->src_mngr, resource_urn));
+      name = photos_source_get_name (source);
+      g_object_set (cell_renderer, "text", name, NULL);
+      gtk_cell_renderer_set_visible (cell_renderer, TRUE);
     }
   else
     {


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