[gnome-photos/wip/rishi/misc-fixes: 4/26] item-manager: Fix a pre-condition check



commit 2f466f51a06efc0517bd52656491d72fdcb18bfb
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Dec 22 13:49:26 2015 +0100

    item-manager: Fix a pre-condition check
    
    This is the go_back counterpart of the previous fix.

 src/photos-item-manager.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index 9ea97ef..1038adb 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -708,11 +708,16 @@ photos_mode_controller_go_back (PhotosModeController *self)
     old_mode = PHOTOS_WINDOW_MODE_OVERVIEW;
 
   g_return_if_fail (old_mode != PHOTOS_WINDOW_MODE_NONE);
-  g_return_if_fail (old_mode != PHOTOS_WINDOW_MODE_PREVIEW
-                    || (self->mode == PHOTOS_WINDOW_MODE_EDIT && old_mode == PHOTOS_WINDOW_MODE_PREVIEW));
 
   if (self->mode == PHOTOS_WINDOW_MODE_EDIT)
-    g_return_if_fail (self->load_state == PHOTOS_LOAD_STATE_FINISHED);
+    {
+      g_return_if_fail (self->load_state == PHOTOS_LOAD_STATE_FINISHED);
+      g_return_if_fail (old_mode == PHOTOS_WINDOW_MODE_PREVIEW);
+    }
+  else
+    {
+      g_return_if_fail (old_mode != PHOTOS_WINDOW_MODE_PREVIEW);
+    }
 
   g_queue_pop_head (self->history);
 


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