[gnome-calendar] event-widget: add method to pass its internal data
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] event-widget: add method to pass its internal data
- Date: Thu, 4 Dec 2014 22:34:33 +0000 (UTC)
commit 19c3c4e94f6f17b1b649d9aafab4669730bdf2f3
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Mon Oct 6 12:13:22 2014 -0400
event-widget: add method to pass its internal data
src/gcal-event-widget.c | 27 ++++++++++++++++++++++++++-
src/gcal-event-widget.h | 2 ++
2 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-event-widget.c b/src/gcal-event-widget.c
index 04f29c0..f5d2c16 100644
--- a/src/gcal-event-widget.c
+++ b/src/gcal-event-widget.c
@@ -677,7 +677,7 @@ gcal_event_widget_new_from_data (GcalEventData *data)
/* summary */
e_cal_component_get_summary (priv->component, &e_summary);
- gcal_event_widget_set_summary (event, e_summary.value);
+ gcal_event_widget_set_summary (event, (gchar*) e_summary.value);
/* color */
color = g_new0 (GdkRGBA, 1);
@@ -887,3 +887,28 @@ gcal_event_widget_get_has_reminders (GcalEventWidget *event)
g_object_get (event, "has-reminders", &has_reminders, NULL);
return has_reminders;
}
+
+/**
+ * gcal_event_widget_get_data:
+ * @event: a #GcalEventWidget instance
+ *
+ * Returns a #GcalEventData with shallows members, meaning the members
+ * are owned but the struct should be freed.
+ *
+ * Returns: (transfer full): a #GcalEventData
+ **/
+GcalEventData*
+gcal_event_widget_get_data (GcalEventWidget *event)
+{
+ GcalEventWidgetPrivate *priv;
+ GcalEventData *data;
+
+ g_return_val_if_fail (GCAL_IS_EVENT_WIDGET (event), NULL);
+ priv = gcal_event_widget_get_instance_private (event);
+
+ data = g_new0 (GcalEventData, 1);
+ data->source = priv->source;
+ data->event_component = priv->component;
+
+ return data;
+}
diff --git a/src/gcal-event-widget.h b/src/gcal-event-widget.h
index 65fcb94..3afc51f 100644
--- a/src/gcal-event-widget.h
+++ b/src/gcal-event-widget.h
@@ -93,6 +93,8 @@ void gcal_event_widget_set_has_reminders (GcalEventWidget *
gboolean gcal_event_widget_get_has_reminders (GcalEventWidget *event);
+GcalEventData* gcal_event_widget_get_data (GcalEventWidget *event);
+
G_END_DECLS
#endif /* __GCAL_EVENT_WIDGET_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]