[evolution-data-server/wip/mcrha/libical-glib] Changes for e-cal-client-view.c/h and e-timezone-cache.c/h (only API and themselves)



commit 93b7bc2a63df63d6fe02d16e305d2413cd0cfc39
Author: Milan Crha <mcrha redhat com>
Date:   Thu Feb 7 12:34:25 2019 +0100

    Changes for e-cal-client-view.c/h and e-timezone-cache.c/h (only API and themselves)

 src/calendar/libecal/e-cal-client-view.c | 36 ++++++++++++++------------------
 src/calendar/libecal/e-cal-client-view.h |  8 +++----
 src/calendar/libecal/e-timezone-cache.c  | 31 +++++++++++++--------------
 src/calendar/libecal/e-timezone-cache.h  | 17 ++++++++-------
 4 files changed, 45 insertions(+), 47 deletions(-)
---
diff --git a/src/calendar/libecal/e-cal-client-view.c b/src/calendar/libecal/e-cal-client-view.c
index 065d1f8f3..9da88897f 100644
--- a/src/calendar/libecal/e-cal-client-view.c
+++ b/src/calendar/libecal/e-cal-client-view.c
@@ -106,13 +106,8 @@ signal_closure_free (SignalClosure *signal_closure)
 {
        g_weak_ref_clear (&signal_closure->client_view);
 
-       g_slist_free_full (
-               signal_closure->component_list,
-               (GDestroyNotify) icalcomponent_free);
-
-       g_slist_free_full (
-               signal_closure->component_id_list,
-               (GDestroyNotify) e_cal_component_free_id);
+       g_slist_free_full (signal_closure->component_list, g_object_unref);
+       g_slist_free_full (signal_closure->component_id_list, e_cal_component_id_free);
 
        g_free (signal_closure->message);
 
@@ -154,7 +149,7 @@ cal_client_view_set_main_context (ECalClientView *client_view,
        g_mutex_unlock (&client_view->priv->main_context_lock);
 }
 
-static GSList *
+static GSList * /* ICalComponent * */
 build_object_list (const gchar * const *seq)
 {
        GSList *list;
@@ -162,9 +157,9 @@ build_object_list (const gchar * const *seq)
 
        list = NULL;
        for (i = 0; seq[i]; i++) {
-               icalcomponent *comp;
+               ICalComponent *comp;
 
-               comp = icalcomponent_new_from_string ((gchar *) seq[i]);
+               comp = i_cal_component_new_from_string (seq[i]);
                if (!comp)
                        continue;
 
@@ -174,7 +169,7 @@ build_object_list (const gchar * const *seq)
        return g_slist_reverse (list);
 }
 
-static GSList *
+static GSList * /* ECalComponentId * */
 build_id_list (const gchar * const *seq)
 {
        GSList *list;
@@ -184,17 +179,15 @@ build_id_list (const gchar * const *seq)
        list = NULL;
        for (i = 0; seq[i]; i++) {
                ECalComponentId *id;
-               id = g_new (ECalComponentId, 1);
 
                /* match encoding as in notify_remove()
                 * in e-data-cal-view.c: <uid>[\n<rid>] */
                eol = strchr (seq[i], '\n');
                if (eol) {
-                       id->uid = g_strndup (seq[i], eol - seq[i]);
-                       id->rid = g_strdup (eol + 1);
+                       id = e_cal_component_id_new_take (g_strndup (seq[i], eol - seq[i]),
+                                                         g_strdup (eol + 1));
                } else {
-                       id->uid = g_strdup (seq[i]);
-                       id->rid = NULL;
+                       id = e_cal_component_id_new (seq[i], NULL);
                }
 
                list = g_slist_prepend (list, id);
@@ -811,7 +804,8 @@ e_cal_client_view_class_init (ECalClientViewClass *class)
        /**
         * ECalClientView::objects-added:
         * @client_view: the #ECalClientView which emitted the signal
-        * @objects: (type GSList) (transfer none) (element-type long):
+        * @objects: (type GSList) (transfer none) (element-type ICalComponent): a #GSList
+        *    of added #ICalComponent objects into the @client_view.
         */
        signals[OBJECTS_ADDED] = g_signal_new (
                "objects-added",
@@ -825,7 +819,8 @@ e_cal_client_view_class_init (ECalClientViewClass *class)
        /**
         * ECalClientView::objects-modified:
         * @client_view: the #ECalClientView which emitted the signal
-        * @objects: (type GSList) (transfer none) (element-type long):
+        * @objects: (type GSList) (transfer none) (element-type ICalComponent): a #GSList
+        *    of modified #ICalComponent objects within the @client_view
         */
        signals[OBJECTS_MODIFIED] = g_signal_new (
                "objects-modified",
@@ -839,7 +834,8 @@ e_cal_client_view_class_init (ECalClientViewClass *class)
        /**
         * ECalClientView::objects-removed:
         * @client_view: the #ECalClientView which emitted the signal
-        * @objects: (type GSList) (transfer none) (element-type ECalComponentId):
+        * @uids: (type GSList) (transfer none) (element-type ECalComponentId): a #GSList
+        *    of removed objects, described by their UID and eventually RID, as an #ECalComponentId structure.
         */
        signals[OBJECTS_REMOVED] = g_signal_new (
                "objects-removed",
@@ -1028,7 +1024,7 @@ e_cal_client_view_stop (ECalClientView *client_view,
 /**
  * e_cal_client_view_set_fields_of_interest:
  * @client_view: an #ECalClientView
- * @fields_of_interest: (element-type utf8) (allow-none): List of field names
+ * @fields_of_interest: (element-type utf8) (nullable): List of field names
  *                      in which the client is interested, or %NULL to reset
  *                      the fields of interest
  * @error: return location for a #GError, or %NULL
diff --git a/src/calendar/libecal/e-cal-client-view.h b/src/calendar/libecal/e-cal-client-view.h
index effdae783..00cf318c2 100644
--- a/src/calendar/libecal/e-cal-client-view.h
+++ b/src/calendar/libecal/e-cal-client-view.h
@@ -102,11 +102,11 @@ struct _ECalClientViewClass {
        /*< public >*/
        /* Signals */
        void            (*objects_added)        (ECalClientView *client_view,
-                                                const GSList *objects);
+                                                const GSList *objects); /* ICalComponent * */
        void            (*objects_modified)     (ECalClientView *client_view,
-                                                const GSList *objects);
+                                                const GSList *objects); /* ICalComponent * */
        void            (*objects_removed)      (ECalClientView *client_view,
-                                                const GSList *uids);
+                                                const GSList *uids); /* ECalComponentId * */
        void            (*progress)             (ECalClientView *client_view,
                                                 guint percent,
                                                 const gchar *message);
@@ -125,7 +125,7 @@ const gchar *       e_cal_client_view_get_object_path
 gboolean       e_cal_client_view_is_running    (ECalClientView *client_view);
 void           e_cal_client_view_set_fields_of_interest
                                                (ECalClientView *client_view,
-                                                const GSList *fields_of_interest,
+                                                const GSList *fields_of_interest, /* gchar * */
                                                 GError **error);
 void           e_cal_client_view_start         (ECalClientView *client_view,
                                                 GError **error);
diff --git a/src/calendar/libecal/e-timezone-cache.c b/src/calendar/libecal/e-timezone-cache.c
index 0f0f86a75..dee781ac5 100644
--- a/src/calendar/libecal/e-timezone-cache.c
+++ b/src/calendar/libecal/e-timezone-cache.c
@@ -20,7 +20,7 @@
  * @include: libecal/libecal.h
  * @short_description: An interface for caching time zone data
  *
- * Several classes (both client-side and server-side) cache #icaltimezone
+ * Several classes (both client-side and server-side) cache #ICalTimezone
  * instances internally, indexed by their TZID strings.  Classes which do
  * this should implement #ETimezoneCacheInterface to provide a consistent
  * API for accessing time zone data.
@@ -39,7 +39,7 @@ e_timezone_cache_default_init (ETimezoneCacheInterface *iface)
        /**
         * ETimezoneCache::timezone-added:
         * @cache: the #ETimezoneCache which emitted the signal
-        * @zone: the newly-added #icaltimezone
+        * @zone: the newly-added #ICalTimezone
         *
         * Emitted when a new #icaltimezone is added to @cache.
         **/
@@ -50,29 +50,29 @@ e_timezone_cache_default_init (ETimezoneCacheInterface *iface)
                G_STRUCT_OFFSET (ETimezoneCacheInterface, timezone_added),
                NULL, NULL, NULL,
                G_TYPE_NONE, 1,
-               G_TYPE_POINTER);
+               I_CAL_TYPE_TIMEZONE);
 }
 
 /**
  * e_timezone_cache_add_timezone:
  * @cache: an #ETimezoneCache
- * @zone: an #icaltimezone
+ * @zone: an #ICalTimezone
  *
  * Adds a copy of @zone to @cache and emits a
  * #ETimezoneCache::timezone-added signal.  The @cache will use the TZID
- * string returned by icaltimezone_get_tzid() as the lookup key, which can
+ * string returned by i_cal_timezone_get_tzid() as the lookup key, which can
  * be passed to e_timezone_cache_get_timezone() to obtain @zone again.
  *
- * If the @cache already has an #icaltimezone with the same TZID string
+ * If the @cache already has an #ICalTimezone with the same TZID string
  * as @zone, the @cache will remain unchanged to avoid invalidating any
- * #icaltimezone pointers which may have already been returned through
+ * #ICalTimezone pointers which may have already been returned through
  * e_timezone_cache_get_timezone().
  *
  * Since: 3.8
  **/
 void
 e_timezone_cache_add_timezone (ETimezoneCache *cache,
-                               icaltimezone *zone)
+                              ICalTimezone *zone)
 {
        ETimezoneCacheInterface *iface;
 
@@ -90,15 +90,15 @@ e_timezone_cache_add_timezone (ETimezoneCache *cache,
  * @cache: an #ETimezoneCache
  * @tzid: the TZID of a timezone
  *
- * Obtains an #icaltimezone by its TZID string.  If no match is found,
- * the function returns %NULL.  The returned #icaltimezone is owned by
+ * Obtains an #ICalTimezone by its TZID string.  If no match is found,
+ * the function returns %NULL.  The returned #ICalTimezone is owned by
  * the @cache and should not be modified or freed.
  *
- * Returns: an #icaltimezone, or %NULL
+ * Returns: (transfer none) (nullable): an #ICalTimezone, or %NULL
  *
  * Since: 3.8
  **/
-icaltimezone *
+ICalTimezone *
 e_timezone_cache_get_timezone (ETimezoneCache *cache,
                                const gchar *tzid)
 {
@@ -117,7 +117,7 @@ e_timezone_cache_get_timezone (ETimezoneCache *cache,
  * e_timezone_cache_list_timezones:
  * @cache: an #ETimezoneCache
  *
- * Returns a list of #icaltimezone instances that were explicitly added to
+ * Returns a list of #ICalTimezone instances that were explicitly added to
  * the @cache through e_timezone_cache_add_timezone().  In particular, any
  * built-in time zone data that e_timezone_cache_get_timezone() may use to
  * match a TZID string is excluded from the returned list.
@@ -125,8 +125,8 @@ e_timezone_cache_get_timezone (ETimezoneCache *cache,
  * Free the returned list with g_list_free().  The list elements are owned
  * by the @cache and should not be modified or freed.
  *
- * Returns: (transfer container) (element-type icaltimezone): a #GList of
- *          #icaltimezone instances
+ * Returns: (transfer container) (element-type ICalTimezone): a #GList of
+ *    #ICalTimezone instances
  *
  * Since: 3.8
  **/
@@ -142,4 +142,3 @@ e_timezone_cache_list_timezones (ETimezoneCache *cache)
 
        return iface->list_timezones (cache);
 }
-
diff --git a/src/calendar/libecal/e-timezone-cache.h b/src/calendar/libecal/e-timezone-cache.h
index af1b46de7..91240bd80 100644
--- a/src/calendar/libecal/e-timezone-cache.h
+++ b/src/calendar/libecal/e-timezone-cache.h
@@ -64,22 +64,25 @@ struct _ETimezoneCacheInterface {
        /*< public >*/
        /* Methods */
        void            (*add_timezone)         (ETimezoneCache *cache,
-                                                icaltimezone *zone);
-       icaltimezone *  (*get_timezone)         (ETimezoneCache *cache,
+                                                ICalTimezone *zone);
+       ICalTimezone *  (*get_timezone)         (ETimezoneCache *cache,
                                                 const gchar *tzid);
-       GList *         (*list_timezones)       (ETimezoneCache *cache);
+       GList *         (*list_timezones)       (ETimezoneCache *cache); /* ICalTimezone * */
 
        /* Signals */
        void            (*timezone_added)       (ETimezoneCache *cache,
-                                                icaltimezone *zone);
+                                                ICalTimezone *zone);
+
+       /* Padding for future expansion */
+       gpointer reserved_signals[4];
 };
 
 GType          e_timezone_cache_get_type       (void) G_GNUC_CONST;
 void           e_timezone_cache_add_timezone   (ETimezoneCache *cache,
-                                                icaltimezone *zone);
-icaltimezone * e_timezone_cache_get_timezone   (ETimezoneCache *cache,
+                                                ICalTimezone *zone);
+ICalTimezone * e_timezone_cache_get_timezone   (ETimezoneCache *cache,
                                                 const gchar *tzid);
-GList *                e_timezone_cache_list_timezones (ETimezoneCache *cache);
+GList *                e_timezone_cache_list_timezones (ETimezoneCache *cache); /* ICalTimezone * */
 
 G_END_DECLS
 


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