[gnome-photos/wip/rishi/edit-mode: 6/32] embed: Don't reset the PreviewView when returning from edit mode



commit c8d6e5236e2dbdf2cd6ce55cb8db036f9aceaf59
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu May 7 08:36:50 2015 +0200

    embed: Don't reset the PreviewView when returning from edit mode

 src/photos-embed.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-embed.c b/src/photos-embed.c
index a3f8966..f5fe8c9 100644
--- a/src/photos-embed.c
+++ b/src/photos-embed.c
@@ -305,8 +305,10 @@ photos_embed_prepare_for_preview (PhotosEmbed *self, PhotosWindowMode old_mode)
       g_action_change_state (priv->search_action, state);
     }
 
-  /* This is not needed when activated from the search provider. */
-  if (old_mode != PHOTOS_WINDOW_MODE_NONE)
+  /* This is not needed when activated from the search provider, or
+   * when returning from the edit mode.
+   */
+  if (old_mode != PHOTOS_WINDOW_MODE_NONE && old_mode != PHOTOS_WINDOW_MODE_EDIT)
     {
       GtkListStore *model;
       GtkTreePath *current_path;
@@ -318,8 +320,10 @@ photos_embed_prepare_for_preview (PhotosEmbed *self, PhotosWindowMode old_mode)
       photos_preview_view_set_model (PHOTOS_PREVIEW_VIEW (priv->preview), GTK_TREE_MODEL (model), 
current_path);
     }
 
+  if (old_mode != PHOTOS_WINDOW_MODE_EDIT)
+    photos_preview_view_set_node (PHOTOS_PREVIEW_VIEW (priv->preview), NULL);
+
   photos_spinner_box_stop (PHOTOS_SPINNER_BOX (priv->spinner_box));
-  photos_preview_view_set_node (PHOTOS_PREVIEW_VIEW (priv->preview), NULL);
   gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "preview");
 }
 


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