"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/calendar/libecal/e-timezone-cache.c" between
evolution-data-server-3.32.4.tar.xz and evolution-data-server-3.34.0.tar.xz

About: Evolution-Data-Server manages access to the calendar, tasks and addressbook information available for Evolution and other applications.

e-timezone-cache.c  (evolution-data-server-3.32.4.tar.xz):e-timezone-cache.c  (evolution-data-server-3.34.0.tar.xz)
skipping to change at line 23 skipping to change at line 23
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>. * along with this library. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
/** /**
* SECTION: e-timezone-cache * SECTION: e-timezone-cache
* @include: libecal/libecal.h * @include: libecal/libecal.h
* @short_description: An interface for caching time zone data * @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 * instances internally, indexed by their TZID strings. Classes which do
* this should implement #ETimezoneCacheInterface to provide a consistent * this should implement #ETimezoneCacheInterface to provide a consistent
* API for accessing time zone data. * API for accessing time zone data.
**/ **/
#include "e-timezone-cache.h" #include "e-timezone-cache.h"
G_DEFINE_INTERFACE ( G_DEFINE_INTERFACE (
ETimezoneCache, ETimezoneCache,
e_timezone_cache, e_timezone_cache,
G_TYPE_OBJECT) G_TYPE_OBJECT)
static void static void
e_timezone_cache_default_init (ETimezoneCacheInterface *iface) e_timezone_cache_default_init (ETimezoneCacheInterface *iface)
{ {
/** /**
* ETimezoneCache::timezone-added: * ETimezoneCache::timezone-added:
* @cache: the #ETimezoneCache which emitted the signal * @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. * Emitted when a new #icaltimezone is added to @cache.
**/ **/
g_signal_new ( g_signal_new (
"timezone-added", "timezone-added",
G_OBJECT_CLASS_TYPE (iface), G_OBJECT_CLASS_TYPE (iface),
G_SIGNAL_RUN_FIRST, G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (ETimezoneCacheInterface, timezone_added), G_STRUCT_OFFSET (ETimezoneCacheInterface, timezone_added),
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
G_TYPE_POINTER); I_CAL_TYPE_TIMEZONE);
} }
/** /**
* e_timezone_cache_add_timezone: * e_timezone_cache_add_timezone:
* @cache: an #ETimezoneCache * @cache: an #ETimezoneCache
* @zone: an #icaltimezone * @zone: an #ICalTimezone
* *
* Adds a copy of @zone to @cache and emits a * Adds a copy of @zone to @cache and emits a
* #ETimezoneCache::timezone-added signal. The @cache will use the TZID * #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. * 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 * 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(). * e_timezone_cache_get_timezone().
* *
* Since: 3.8 * Since: 3.8
**/ **/
void void
e_timezone_cache_add_timezone (ETimezoneCache *cache, e_timezone_cache_add_timezone (ETimezoneCache *cache,
icaltimezone *zone) ICalTimezone *zone)
{ {
ETimezoneCacheInterface *iface; ETimezoneCacheInterface *iface;
g_return_if_fail (E_IS_TIMEZONE_CACHE (cache)); g_return_if_fail (E_IS_TIMEZONE_CACHE (cache));
g_return_if_fail (zone != NULL); g_return_if_fail (zone != NULL);
iface = E_TIMEZONE_CACHE_GET_INTERFACE (cache); iface = E_TIMEZONE_CACHE_GET_INTERFACE (cache);
g_return_if_fail (iface->add_timezone != NULL); g_return_if_fail (iface->tzcache_add_timezone != NULL);
iface->add_timezone (cache, zone); iface->tzcache_add_timezone (cache, zone);
} }
/** /**
* e_timezone_cache_get_timezone: * e_timezone_cache_get_timezone:
* @cache: an #ETimezoneCache * @cache: an #ETimezoneCache
* @tzid: the TZID of a timezone * @tzid: the TZID of a timezone
* *
* Obtains an #icaltimezone by its TZID string. If no match is found, * Obtains an #ICalTimezone by its TZID string. If no match is found,
* the function returns %NULL. The returned #icaltimezone is owned by * the function returns %NULL. The returned #ICalTimezone is owned by
* the @cache and should not be modified or freed. * 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 * Since: 3.8
**/ **/
icaltimezone * ICalTimezone *
e_timezone_cache_get_timezone (ETimezoneCache *cache, e_timezone_cache_get_timezone (ETimezoneCache *cache,
const gchar *tzid) const gchar *tzid)
{ {
ETimezoneCacheInterface *iface; ETimezoneCacheInterface *iface;
g_return_val_if_fail (E_IS_TIMEZONE_CACHE (cache), NULL); g_return_val_if_fail (E_IS_TIMEZONE_CACHE (cache), NULL);
g_return_val_if_fail (tzid != NULL, NULL); g_return_val_if_fail (tzid != NULL, NULL);
iface = E_TIMEZONE_CACHE_GET_INTERFACE (cache); iface = E_TIMEZONE_CACHE_GET_INTERFACE (cache);
g_return_val_if_fail (iface->get_timezone != NULL, NULL); g_return_val_if_fail (iface->tzcache_get_timezone != NULL, NULL);
return iface->get_timezone (cache, tzid); return iface->tzcache_get_timezone (cache, tzid);
} }
/** /**
* e_timezone_cache_list_timezones: * e_timezone_cache_list_timezones:
* @cache: an #ETimezoneCache * @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 * 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 * built-in time zone data that e_timezone_cache_get_timezone() may use to
* match a TZID string is excluded from the returned list. * match a TZID string is excluded from the returned list.
* *
* Free the returned list with g_list_free(). The list elements are owned * Free the returned list with g_list_free(). The list elements are owned
* by the @cache and should not be modified or freed. * by the @cache and should not be modified or freed.
* *
* Returns: (transfer container) (element-type icaltimezone): a #GList of * Returns: (transfer container) (element-type ICalTimezone): a #GList of
* #icaltimezone instances * #ICalTimezone instances
* *
* Since: 3.8 * Since: 3.8
**/ **/
GList * GList *
e_timezone_cache_list_timezones (ETimezoneCache *cache) e_timezone_cache_list_timezones (ETimezoneCache *cache)
{ {
ETimezoneCacheInterface *iface; ETimezoneCacheInterface *iface;
g_return_val_if_fail (E_IS_TIMEZONE_CACHE (cache), NULL); g_return_val_if_fail (E_IS_TIMEZONE_CACHE (cache), NULL);
iface = E_TIMEZONE_CACHE_GET_INTERFACE (cache); iface = E_TIMEZONE_CACHE_GET_INTERFACE (cache);
g_return_val_if_fail (iface->list_timezones != NULL, NULL); g_return_val_if_fail (iface->tzcache_list_timezones != NULL, NULL);
return iface->list_timezones (cache); return iface->tzcache_list_timezones (cache);
} }
 End of changes. 19 change blocks. 
21 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)