[gnome-calendar/gnome-3-20] manager: keep the Shell's activated event alive



commit 56dd308512ed170d827a0dea4eea638ecccb078d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Jun 29 23:57:00 2016 -0300

    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 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index d790529..635457d 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);


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