[gnome-photos/wip/rishi/collection: 8/17] item-manager: Consolidate the signal emissions in one place
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/collection: 8/17] item-manager: Consolidate the signal emissions in one place
- Date: Fri, 28 Jul 2017 17:05:56 +0000 (UTC)
commit fc07330452f2be777b4d69e52189e6405be03a7f
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Jul 28 14:40:36 2017 +0200
item-manager: Consolidate the signal emissions in one place
This will make the subsequent commits easier to read.
src/photos-item-manager.c | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index aa09582..7d896fe 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -1304,6 +1304,8 @@ photos_mode_controller_go_back (PhotosModeController *self)
{
PhotosWindowMode old_mode;
PhotosWindowMode tmp;
+ gboolean active_changed = FALSE;
+ gboolean active_collection_changed = FALSE;
g_return_if_fail (PHOTOS_IS_MODE_CONTROLLER (self));
g_return_if_fail (!g_queue_is_empty (self->history));
@@ -1363,32 +1365,24 @@ photos_mode_controller_go_back (PhotosModeController *self)
case PHOTOS_WINDOW_MODE_PREVIEW:
self->load_state = PHOTOS_LOAD_STATE_NONE;
g_set_object (&self->active_object, G_OBJECT (self->active_collection));
- g_signal_emit_by_name (self, "active-changed", self->active_object);
+ active_changed = TRUE;
break;
case PHOTOS_WINDOW_MODE_COLLECTIONS:
case PHOTOS_WINDOW_MODE_FAVORITES:
case PHOTOS_WINDOW_MODE_OVERVIEW:
case PHOTOS_WINDOW_MODE_SEARCH:
- {
- gboolean active_collection_changed = FALSE;
-
- if (self->active_collection != NULL)
- {
- g_clear_object (&self->active_collection);
- active_collection_changed = TRUE;
- }
-
- g_clear_object (&self->active_object);
- self->load_state = PHOTOS_LOAD_STATE_NONE;
-
- g_signal_emit_by_name (self, "active-changed", self->active_object);
+ if (self->active_collection != NULL)
+ {
+ g_clear_object (&self->active_collection);
+ active_collection_changed = TRUE;
+ }
- if (active_collection_changed)
- g_signal_emit (self, signals[ACTIVE_COLLECTION_CHANGED], 0, self->active_collection);
+ g_clear_object (&self->active_object);
+ active_changed = TRUE;
- break;
- }
+ self->load_state = PHOTOS_LOAD_STATE_NONE;
+ break;
case PHOTOS_WINDOW_MODE_NONE:
default:
@@ -1396,6 +1390,12 @@ photos_mode_controller_go_back (PhotosModeController *self)
break;
}
+ if (active_changed)
+ g_signal_emit_by_name (self, "active-changed", self->active_object);
+
+ if (active_collection_changed)
+ g_signal_emit (self, signals[ACTIVE_COLLECTION_CHANGED], 0, self->active_collection);
+
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]