[gnome-photos/wip/rishi/collection: 10/17] main-toolbar: Be more strict about what is acceptable
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/collection: 10/17] main-toolbar: Be more strict about what is acceptable
- Date: Fri, 28 Jul 2017 17:06:06 +0000 (UTC)
commit 780b52f24dadf98de0c9dd2751d4ae0093d053db
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Jul 28 15:28:43 2017 +0200
main-toolbar: Be more strict about what is acceptable
src/photos-main-toolbar.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-main-toolbar.c b/src/photos-main-toolbar.c
index cce9fbe..ae4a687 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -113,10 +113,21 @@ photos_main_toolbar_set_toolbar_title (PhotosMainToolbar *self)
gboolean selection_mode;
gchar *primary = NULL;
- active_collection = photos_item_manager_get_active_collection (PHOTOS_ITEM_MANAGER (self->item_mngr));
selection_mode = photos_utils_get_selection_mode ();
window_mode = photos_mode_controller_get_window_mode (self->mode_cntrlr);
+ if (selection_mode)
+ {
+ g_return_if_fail (window_mode == PHOTOS_WINDOW_MODE_COLLECTIONS
+ || window_mode == PHOTOS_WINDOW_MODE_FAVORITES
+ || window_mode == PHOTOS_WINDOW_MODE_OVERVIEW
+ || window_mode == PHOTOS_WINDOW_MODE_SEARCH);
+ }
+
+ if (window_mode == PHOTOS_WINDOW_MODE_EDIT || window_mode == PHOTOS_WINDOW_MODE_PREVIEW)
+ g_return_if_fail (!selection_mode);
+
+ active_collection = photos_item_manager_get_active_collection (PHOTOS_ITEM_MANAGER (self->item_mngr));
if (window_mode == PHOTOS_WINDOW_MODE_OVERVIEW
|| window_mode == PHOTOS_WINDOW_MODE_COLLECTIONS
|| window_mode == PHOTOS_WINDOW_MODE_FAVORITES
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]