[gnome-calendar] event-widget: add convenient API to query dates
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] event-widget: add convenient API to query dates
- Date: Thu, 18 Dec 2014 14:06:47 +0000 (UTC)
commit 51c7e5e2eacc9e7e129802da4eafc05fa3fdaae8
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Thu Dec 18 00:56:46 2014 -0500
event-widget: add convenient API to query dates
Simply it is faster not to allocate memory when there is no need of it
src/gcal-event-widget.c | 34 ++++++++++++++++++++++++++++++++++
src/gcal-event-widget.h | 4 ++++
2 files changed, 38 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-event-widget.c b/src/gcal-event-widget.c
index b74879a..f3a8a38 100644
--- a/src/gcal-event-widget.c
+++ b/src/gcal-event-widget.c
@@ -911,6 +911,23 @@ gcal_event_widget_get_date (GcalEventWidget *event)
}
/**
+ * gcal_event_widget_peek_start_date:
+ * @event:
+ *
+ * Return the starting date of the event.
+ *
+ * Returns: (Transfer none): An { link icaltimetype} instance
+ **/
+const icaltimetype*
+gcal_event_widget_peek_start_date (GcalEventWidget *event)
+{
+ GcalEventWidgetPrivate *priv;
+ priv = gcal_event_widget_get_instance_private (event);
+
+ return priv->dt_start;
+}
+
+/**
* gcal_event_widget_set_end_date:
* @event: a #GcalEventWidget
* @date: a #icaltimetype object with the date
@@ -942,6 +959,23 @@ gcal_event_widget_get_end_date (GcalEventWidget *event)
return dt;
}
+/**
+ * gcal_event_widget_peek_end_date:
+ * @event:
+ *
+ * Return the end date of the event.
+ *
+ * Returns: (Transfer none): An { link icaltimetype} instance
+ **/
+const icaltimetype*
+gcal_event_widget_peek_end_date (GcalEventWidget *event)
+{
+ GcalEventWidgetPrivate *priv;
+ priv = gcal_event_widget_get_instance_private (event);
+
+ return priv->dt_end;
+}
+
void
gcal_event_widget_set_summary (GcalEventWidget *event,
gchar *summary)
diff --git a/src/gcal-event-widget.h b/src/gcal-event-widget.h
index 99fe239..cb8b23c 100644
--- a/src/gcal-event-widget.h
+++ b/src/gcal-event-widget.h
@@ -75,11 +75,15 @@ void gcal_event_widget_set_date (GcalEventWidget *
icaltimetype* gcal_event_widget_get_date (GcalEventWidget *event);
+const icaltimetype* gcal_event_widget_peek_start_date (GcalEventWidget *event);
+
void gcal_event_widget_set_end_date (GcalEventWidget *event,
const icaltimetype *date);
icaltimetype* gcal_event_widget_get_end_date (GcalEventWidget *event);
+const icaltimetype* gcal_event_widget_peek_end_date (GcalEventWidget *event);
+
void gcal_event_widget_set_summary (GcalEventWidget *event,
gchar *summary);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]