[gnome-photos/wip/rishi/collection: 2/15] item-manager: Emit active-collection-changed only when there's a change
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/collection: 2/15] item-manager: Emit active-collection-changed only when there's a change
- Date: Fri, 28 Jul 2017 13:01:17 +0000 (UTC)
commit 2192a49afd62bc74d426eb0d5f4b06123f778486
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Jul 28 12:02:29 2017 +0200
item-manager: Emit active-collection-changed only when there's a change
src/photos-item-manager.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-item-manager.c b/src/photos-item-manager.c
index 16b0108..a5a0751 100644
--- a/src/photos-item-manager.c
+++ b/src/photos-item-manager.c
@@ -1347,12 +1347,21 @@ photos_mode_controller_go_back (PhotosModeController *self)
}
else if (old_mode != PHOTOS_WINDOW_MODE_EDIT)
{
- g_clear_object (&self->active_collection);
+ 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);
- g_signal_emit (self, signals[ACTIVE_COLLECTION_CHANGED], 0, self->active_collection);
+
+ 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]