[gnome-photos] item-manager: Assert that the modes are never NONE



commit 96b1aa13753ae7e01d2fb7bcbe395f4059c50cc2
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Jul 28 13:15:14 2017 +0200

    item-manager: Assert that the modes are never NONE

 src/photos-item-manager.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index 25b8f5c..c11c7c6 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -1326,15 +1326,18 @@ photos_mode_controller_go_back (PhotosModeController *self)
       g_return_if_fail (old_mode == PHOTOS_WINDOW_MODE_PREVIEW);
       break;
 
-    case PHOTOS_WINDOW_MODE_NONE:
     case PHOTOS_WINDOW_MODE_COLLECTIONS:
     case PHOTOS_WINDOW_MODE_FAVORITES:
     case PHOTOS_WINDOW_MODE_OVERVIEW:
     case PHOTOS_WINDOW_MODE_PREVIEW:
     case PHOTOS_WINDOW_MODE_SEARCH:
-    default:
       g_return_if_fail (old_mode != PHOTOS_WINDOW_MODE_PREVIEW);
       break;
+
+    case PHOTOS_WINDOW_MODE_NONE:
+    default:
+      g_assert_not_reached ();
+      break;
     }
 
   g_queue_pop_head (self->history);
@@ -1358,12 +1361,10 @@ photos_mode_controller_go_back (PhotosModeController *self)
       g_signal_emit_by_name (self, "active-changed", self->active_object);
       break;
 
-    case PHOTOS_WINDOW_MODE_NONE:
     case PHOTOS_WINDOW_MODE_COLLECTIONS:
     case PHOTOS_WINDOW_MODE_FAVORITES:
     case PHOTOS_WINDOW_MODE_OVERVIEW:
     case PHOTOS_WINDOW_MODE_SEARCH:
-    default:
       {
         gboolean active_collection_changed = FALSE;
 
@@ -1383,6 +1384,11 @@ photos_mode_controller_go_back (PhotosModeController *self)
 
         break;
       }
+
+    case PHOTOS_WINDOW_MODE_NONE:
+    default:
+      g_assert_not_reached ();
+      break;
     }
 
   g_signal_emit (self, signals[WINDOW_MODE_CHANGED], 0, self->mode, old_mode);


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