[gnome-calendar/ui-rewrite] gcal-event-widget: fix retrieve :summary property



commit 5603d99cfaa92c4012817bd273e109288233de6a
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Tue Jun 11 17:07:13 2013 -0400

    gcal-event-widget: fix retrieve :summary property
    
    Formatting fixes.
    Added functions docs.

 src/gcal-event-widget.c |   28 +++++++++++++++++++++-------
 src/gcal-event-widget.h |   38 +++++++++++++++++++-------------------
 2 files changed, 40 insertions(+), 26 deletions(-)
---
diff --git a/src/gcal-event-widget.c b/src/gcal-event-widget.c
index a798460..18ad2a8 100644
--- a/src/gcal-event-widget.c
+++ b/src/gcal-event-widget.c
@@ -577,15 +577,30 @@ gcal_event_widget_peek_uuid (GcalEventWidget *event)
   return priv->uuid;
 }
 
+/**
+ * gcal_event_widget_set_date:
+ * @event: a #GcalEventWidget
+ * @date: a #icaltimetype object with the date
+ *
+ * Set the start-date of the event
+ **/
 void
-gcal_event_widget_set_date (GcalEventWidget *event,
-                           icaltimetype     *date)
+gcal_event_widget_set_date (GcalEventWidget    *event,
+                            const icaltimetype *date)
 {
   g_return_if_fail (GCAL_IS_EVENT_WIDGET (event));
 
   g_object_set (event, "date-start", date, NULL);
 }
 
+/**
+ * gcal_event_widget_get_date:
+ * @event: a #GcalEventWidget
+ *
+ * Return the starting date of the event
+ *
+ * Returns: (transfer full): Release with g_free
+ **/
 icaltimetype*
 gcal_event_widget_get_date (GcalEventWidget *event)
 {
@@ -609,12 +624,11 @@ gcal_event_widget_set_summary (GcalEventWidget *event,
 gchar*
 gcal_event_widget_get_summary (GcalEventWidget *event)
 {
-  gchar *summary;
-  g_return_val_if_fail (GCAL_IS_EVENT_WIDGET (event), NULL);
+  GcalEventWidgetPrivate *priv;
+
+  priv = event->priv;
 
-  summary = NULL;
-  g_object_get (event, "summary", summary, NULL);
-  return summary;
+  return g_strdup (priv->summary);
 }
 
 void
diff --git a/src/gcal-event-widget.h b/src/gcal-event-widget.h
index 924f993..5ce3154 100644
--- a/src/gcal-event-widget.h
+++ b/src/gcal-event-widget.h
@@ -55,37 +55,37 @@ struct _GcalEventWidget
 
 GType         gcal_event_widget_get_type                   (void);
 
-GtkWidget*    gcal_event_widget_new                        (gchar           *uuid);
+GtkWidget*    gcal_event_widget_new                        (gchar              *uuid);
 
-GtkWidget*    gcal_event_widget_new_with_summary_and_color (const gchar     *summary,
-                                                            const GdkRGBA   *color);
+GtkWidget*    gcal_event_widget_new_with_summary_and_color (const gchar        *summary,
+                                                            const GdkRGBA      *color);
 
-const gchar*  gcal_event_widget_peek_uuid                  (GcalEventWidget *event);
+const gchar*  gcal_event_widget_peek_uuid                  (GcalEventWidget    *event);
 
-void          gcal_event_widget_set_date                   (GcalEventWidget *event,
-                                                            icaltimetype    *date);
+void          gcal_event_widget_set_date                   (GcalEventWidget    *event,
+                                                            const icaltimetype *date);
 
-icaltimetype* gcal_event_widget_get_date                   (GcalEventWidget *event);
+icaltimetype* gcal_event_widget_get_date                   (GcalEventWidget    *event);
 
-void          gcal_event_widget_set_summary                (GcalEventWidget *event,
-                                                            gchar           *summary);
+void          gcal_event_widget_set_summary                (GcalEventWidget    *event,
+                                                            gchar              *summary);
 
-gchar*        gcal_event_widget_get_summary                (GcalEventWidget *event);
+gchar*        gcal_event_widget_get_summary                (GcalEventWidget    *event);
 
-void          gcal_event_widget_set_color                  (GcalEventWidget *event,
-                                                            GdkRGBA         *color);
+void          gcal_event_widget_set_color                  (GcalEventWidget    *event,
+                                                            GdkRGBA            *color);
 
-GdkRGBA*      gcal_event_widget_get_color                  (GcalEventWidget *event);
+GdkRGBA*      gcal_event_widget_get_color                  (GcalEventWidget    *event);
 
-void          gcal_event_widget_set_all_day                (GcalEventWidget *event,
-                                                            gboolean         all_day);
+void          gcal_event_widget_set_all_day                (GcalEventWidget    *event,
+                                                            gboolean            all_day);
 
-gboolean     gcal_event_widget_get_all_day                 (GcalEventWidget *event);
+gboolean     gcal_event_widget_get_all_day                 (GcalEventWidget    *event);
 
-void         gcal_event_widget_set_has_reminders           (GcalEventWidget *event,
-                                                            gboolean         has_reminders);
+void         gcal_event_widget_set_has_reminders           (GcalEventWidget    *event,
+                                                            gboolean            has_reminders);
 
-gboolean     gcal_event_widget_get_has_reminders           (GcalEventWidget *event);
+gboolean     gcal_event_widget_get_has_reminders           (GcalEventWidget    *event);
 
 G_END_DECLS
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]