edit-dialog: unconditionally update event dialog

When setting an event, we might modify the event in such a way that
the edit dialog can be broken if it doesn't update.

Fix that by unconditionally updating the event dialog when setting
an event.
This commit is contained in:
Georges Basile Stavracas Neto
2017-05-22 22:55:10 -03:00
parent ad3e37606d
commit 1ef8fbcb34
+6 -7
View File
@@ -1123,12 +1123,6 @@ void
gcal_edit_dialog_set_event (GcalEditDialog *dialog, gcal_edit_dialog_set_event (GcalEditDialog *dialog,
GcalEvent *event) GcalEvent *event)
{ {
GCAL_ENTRY;
g_return_if_fail (GCAL_IS_EDIT_DIALOG (dialog));
if (g_set_object (&dialog->event, event))
{
GDateTime *date_start; GDateTime *date_start;
GDateTime *date_end; GDateTime *date_end;
cairo_surface_t *surface; cairo_surface_t *surface;
@@ -1136,6 +1130,12 @@ gcal_edit_dialog_set_event (GcalEditDialog *dialog,
const gchar *summary; const gchar *summary;
gboolean all_day; gboolean all_day;
GCAL_ENTRY;
g_return_if_fail (GCAL_IS_EDIT_DIALOG (dialog));
g_set_object (&dialog->event, event);
dialog->setting_event = TRUE; dialog->setting_event = TRUE;
/* If we just set the event to NULL, simply send a property notify */ /* If we just set the event to NULL, simply send a property notify */
@@ -1224,7 +1224,6 @@ out:
g_object_notify (G_OBJECT (dialog), "event"); g_object_notify (G_OBJECT (dialog), "event");
dialog->setting_event = FALSE; dialog->setting_event = FALSE;
}
GCAL_EXIT; GCAL_EXIT;
} }