[gnome-calendar/gnome-3-26] widgets: ensure types on class_init
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/gnome-3-26] widgets: ensure types on class_init
- Date: Wed, 20 Sep 2017 22:14:39 +0000 (UTC)
commit f61275f43754f5e2f47333897b7ad9b382d77ce5
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Sep 20 19:12:09 2017 -0300
widgets: ensure types on class_init
This will avoid GtkBuilder crashing because it couldn't
find the correct type for a given widget.
src/gcal-date-selector.c | 2 ++
src/gcal-edit-dialog.c | 3 +++
src/gcal-window.c | 10 +++++++++-
src/views/gcal-week-view.c | 3 +++
4 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-date-selector.c b/src/gcal-date-selector.c
index 3d173b5..7d2ec7f 100644
--- a/src/gcal-date-selector.c
+++ b/src/gcal-date-selector.c
@@ -189,6 +189,8 @@ gcal_date_selector_class_init (GcalDateSelectorClass *klass)
GtkEntryClass *entry_class = GTK_ENTRY_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ g_type_ensure (GCAL_TYPE_DATE_CHOOSER);
+
object_class->finalize = gcal_date_selector_finalize;
object_class->get_property = gcal_date_selector_get_property;
object_class->set_property = gcal_date_selector_set_property;
diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c
index 5bc967f..1b045fb 100644
--- a/src/gcal-edit-dialog.c
+++ b/src/gcal-edit-dialog.c
@@ -742,6 +742,9 @@ gcal_edit_dialog_class_init (GcalEditDialogClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ g_type_ensure (GCAL_TYPE_DATE_SELECTOR);
+ g_type_ensure (GCAL_TYPE_TIME_SELECTOR);
+
object_class->finalize = gcal_edit_dialog_finalize;
object_class->constructed = gcal_edit_dialog_constructed;
object_class->get_property = gcal_edit_dialog_get_property;
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 19bcbbe..55f4229 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -1457,11 +1457,19 @@ gcal_window_state_event (GtkWidget *widget,
}
static void
-gcal_window_class_init(GcalWindowClass *klass)
+gcal_window_class_init (GcalWindowClass *klass)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
+ g_type_ensure (GCAL_TYPE_EDIT_DIALOG);
+ g_type_ensure (GCAL_TYPE_MONTH_VIEW);
+ g_type_ensure (GCAL_TYPE_QUICK_ADD_POPOVER);
+ g_type_ensure (GCAL_TYPE_SEARCH_VIEW);
+ g_type_ensure (GCAL_TYPE_SOURCE_DIALOG);
+ g_type_ensure (GCAL_TYPE_WEEK_VIEW);
+ g_type_ensure (GCAL_TYPE_YEAR_VIEW);
+
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gcal_window_finalize;
object_class->set_property = gcal_window_set_property;
diff --git a/src/views/gcal-week-view.c b/src/views/gcal-week-view.c
index b60dcd1..96f3dc7 100644
--- a/src/views/gcal-week-view.c
+++ b/src/views/gcal-week-view.c
@@ -588,6 +588,9 @@ gcal_week_view_class_init (GcalWeekViewClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ g_type_ensure (GCAL_TYPE_WEEK_GRID);
+ g_type_ensure (GCAL_TYPE_WEEK_HEADER);
+
object_class->finalize = gcal_week_view_finalize;
object_class->set_property = gcal_week_view_set_property;
object_class->get_property = gcal_week_view_get_property;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]