quick-add-popover: fix event creation again

This commit is contained in:
Georges Basile Stavracas Neto
2016-02-18 04:02:46 -02:00
parent 21aa8ecde4
commit fd6d6e97c9
4 changed files with 44 additions and 25 deletions
+14 -11
View File
@@ -1000,28 +1000,31 @@ gcal_event_set_timezone (GcalEvent *self,
if (self->timezone != timezone)
{
GDateTime *new_dtstart;
g_clear_pointer (&self->timezone, g_time_zone_unref);
self->timezone = g_time_zone_ref (timezone);
/* Swap the timezone from the component start & end dates*/
new_dtstart = g_date_time_to_timezone (self->dt_start, timezone);
gcal_event_set_date_start (self, new_dtstart);
if (self->dt_end)
if (!self->all_day)
{
GDateTime *new_dtend;
GDateTime *new_dtstart;
new_dtend = g_date_time_to_timezone (self->dt_end, timezone);
gcal_event_set_date_end (self, new_dtend);
new_dtstart = g_date_time_to_timezone (self->dt_start, timezone);
gcal_event_set_date_start (self, new_dtstart);
if (self->dt_end)
{
GDateTime *new_dtend;
new_dtend = g_date_time_to_timezone (self->dt_end, timezone);
gcal_event_set_date_end (self, new_dtend);
g_clear_pointer (&new_dtstart, g_date_time_unref);
}
g_clear_pointer (&new_dtstart, g_date_time_unref);
}
g_object_notify (G_OBJECT (self), "timezone");
g_clear_pointer (&new_dtstart, g_date_time_unref);
}
}