widgets: ensure types on class_init
This will avoid GtkBuilder crashing because it couldn't find the correct type for a given widget.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
+9
-1
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user