From 58b193f88638c01efbbe4264e6d3d8855417f7b0 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 29 Jun 2016 23:57:00 -0300 Subject: [PATCH] manager: keep the Shell's activated event alive Currently, the user performs a search in Shell and activates the result. That should show the edit dialog with the event being edited, but it's not happening correctly. Debugging the warnings generated, it was found that the event was being unref()d and, obviously, that was not what we wanted. Fix that by only unref()ing the events we don't want, and keeping the wanted event alive. --- src/gcal-manager.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gcal-manager.c b/src/gcal-manager.c index d7905298..635457d0 100644 --- a/src/gcal-manager.c +++ b/src/gcal-manager.c @@ -1594,12 +1594,11 @@ gcal_manager_get_event_from_shell_search (GcalManager *manager, event = l->data; + /* Found the event */ if (g_strcmp0 (gcal_event_get_uid (event), uuid) == 0) - { - new_event = event; - } - - g_object_unref (event); + new_event = event; + else + g_object_unref (event); } g_list_free (list);