From df8526f4712930ef2e7d2517d2e8279d0d9b17c0 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Sat, 27 Jan 2024 12:40:23 -0300 Subject: [PATCH] event-editor: Cleanup some code Remove the constructed() override, we can do that in init(). --- .../event-editor/gcal-event-editor-dialog.c | 45 +++++++------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/src/gui/event-editor/gcal-event-editor-dialog.c b/src/gui/event-editor/gcal-event-editor-dialog.c index ff967a42..6a9fbd5f 100644 --- a/src/gui/event-editor/gcal-event-editor-dialog.c +++ b/src/gui/event-editor/gcal-event-editor-dialog.c @@ -541,35 +541,6 @@ gcal_event_editor_dialog_finalize (GObject *object) GCAL_EXIT; } -static void -gcal_event_editor_dialog_constructed (GObject *object) -{ - const GActionEntry action_entries[] = - { - { "select-calendar", on_calendar_selected_action_cb, "s" }, - }; - - GcalEventEditorDialog *self; - - self = GCAL_EVENT_EDITOR_DIALOG (object); - - /* chaining up */ - G_OBJECT_CLASS (gcal_event_editor_dialog_parent_class)->constructed (object); - - adw_dialog_set_title (ADW_DIALOG (object), ""); - - /* Actions */ - self->action_group = g_simple_action_group_new (); - g_action_map_add_action_entries (G_ACTION_MAP (self->action_group), - action_entries, - G_N_ELEMENTS (action_entries), - self); - - gtk_widget_insert_action_group (GTK_WIDGET (self), - "event-editor-dialog", - G_ACTION_GROUP (self->action_group)); -} - static void gcal_event_editor_dialog_get_property (GObject *object, guint prop_id, @@ -634,7 +605,6 @@ gcal_event_editor_dialog_class_init (GcalEventEditorDialogClass *klass) g_type_ensure (GCAL_TYPE_SUMMARY_SECTION); object_class->finalize = gcal_event_editor_dialog_finalize; - object_class->constructed = gcal_event_editor_dialog_constructed; object_class->get_property = gcal_event_editor_dialog_get_property; object_class->set_property = gcal_event_editor_dialog_set_property; @@ -709,10 +679,25 @@ gcal_event_editor_dialog_class_init (GcalEventEditorDialogClass *klass) static void gcal_event_editor_dialog_init (GcalEventEditorDialog *self) { + const GActionEntry action_entries[] = { + { "select-calendar", on_calendar_selected_action_cb, "s" }, + }; gint i = 0; self->writable = TRUE; + /* Actions */ + self->action_group = g_simple_action_group_new (); + g_action_map_add_action_entries (G_ACTION_MAP (self->action_group), + action_entries, + G_N_ELEMENTS (action_entries), + self); + + gtk_widget_insert_action_group (GTK_WIDGET (self), + "event-editor-dialog", + G_ACTION_GROUP (self->action_group)); + + gtk_widget_init_template (GTK_WIDGET (self)); self->sections[i++] = self->notes_section;