event-editor/notes-section: Remove "context" property
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/702>
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
|
||||
#define G_LOG_DOMAIN "GcalNotesSection"
|
||||
|
||||
#include "gcal-context.h"
|
||||
#include "gcal-debug.h"
|
||||
#include "gcal-event-editor-section.h"
|
||||
#include "gcal-notes-section.h"
|
||||
@@ -32,7 +31,6 @@ struct _GcalNotesSection
|
||||
GtkTextView *notes_text;
|
||||
GtkLabel *placeholder;
|
||||
|
||||
GcalContext *context;
|
||||
GcalEvent *event;
|
||||
};
|
||||
|
||||
@@ -41,13 +39,6 @@ static void gcal_event_editor_section_iface_init (GcalEventEdito
|
||||
G_DEFINE_TYPE_WITH_CODE (GcalNotesSection, gcal_notes_section, ADW_TYPE_PREFERENCES_ROW,
|
||||
G_IMPLEMENT_INTERFACE (GCAL_TYPE_EVENT_EDITOR_SECTION, gcal_event_editor_section_iface_init))
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_CONTEXT,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
/*
|
||||
* Callbacks
|
||||
*/
|
||||
@@ -155,51 +146,11 @@ gcal_notes_section_finalize (GObject *object)
|
||||
{
|
||||
GcalNotesSection *self = (GcalNotesSection *)object;
|
||||
|
||||
g_clear_object (&self->context);
|
||||
g_clear_object (&self->event);
|
||||
|
||||
G_OBJECT_CLASS (gcal_notes_section_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gcal_notes_section_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GcalNotesSection *self = GCAL_NOTES_SECTION (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_CONTEXT:
|
||||
g_value_set_object (value, self->context);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gcal_notes_section_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GcalNotesSection *self = GCAL_NOTES_SECTION (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_CONTEXT:
|
||||
g_assert (self->context == NULL);
|
||||
self->context = g_value_dup_object (value);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gcal_notes_section_class_init (GcalNotesSectionClass *klass)
|
||||
{
|
||||
@@ -207,10 +158,6 @@ gcal_notes_section_class_init (GcalNotesSectionClass *klass)
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
object_class->finalize = gcal_notes_section_finalize;
|
||||
object_class->get_property = gcal_notes_section_get_property;
|
||||
object_class->set_property = gcal_notes_section_set_property;
|
||||
|
||||
g_object_class_override_property (object_class, PROP_CONTEXT, "context");
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/event-editor/gcal-notes-section.ui");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user