/* Evolution calendar - Utilities for manipulating CalComponent objects * * Copyright (C) 2000 Ximian, Inc. * Copyright (C) 2000 Ximian, Inc. * * Author: Federico Mena-Quintero * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include #endif #include "comp-util.h" /** * cal_comp_util_add_exdate: * @comp: A calendar component object. * @itt: Time for the exception. * * Adds an exception date to the current list of EXDATE properties in a calendar * component object. **/ void cal_comp_util_add_exdate (CalComponent *comp, time_t t, icaltimezone *zone) { GSList *list; CalComponentDateTime *cdt; g_return_if_fail (comp != NULL); g_return_if_fail (IS_CAL_COMPONENT (comp)); cal_component_get_exdate_list (comp, &list); cdt = g_new (CalComponentDateTime, 1); cdt->value = g_new (struct icaltimetype, 1); *cdt->value = icaltime_from_timet_with_zone (t, TRUE, zone); cdt->tzid = g_strdup (icaltimezone_get_tzid (zone)); list = g_slist_append (list, cdt); cal_component_set_exdate_list (comp, list); cal_component_free_exdate_list (list); } /* Returns TRUE if the TZIDs are equivalent, i.e. both NULL or the same. */ static gboolean cal_component_compare_tzid (const char *tzid1, const char *tzid2) { gboolean retval = TRUE; if (tzid1) { if (!tzid2 || strcmp (tzid1, tzid2)) retval = FALSE; } else { if (tzid2) retval = FALSE; } return retval; } /** * cal_comp_util_compare_event_timezones: * @comp: A calendar component object. * @client: A #CalClient. * * Checks if the component uses the given timezone for both the start and * the end time, or if the UTC offsets of the start and end times are the same * as in the given zone. * * Returns: TRUE if the component's start and end time are at the same UTC * offset in the given timezone. **/ gboolean cal_comp_util_compare_event_timezones (CalComponent *comp, CalClient *client, icaltimezone *zone) { CalClientGetStatus status; CalComponentDateTime start_datetime, end_datetime; const char *tzid; gboolean retval = FALSE; icaltimezone *start_zone, *end_zone; int offset1, offset2; tzid = icaltimezone_get_tzid (zone); cal_component_get_dtstart (comp, &start_datetime); cal_component_get_dtend (comp, &end_datetime); /* FIXME: DURATION may be used instead. */ if (cal_component_compare_tzid (tzid, start_datetime.tzid) && cal_component_compare_tzid (tzid, end_datetime.tzid)) { /* If both TZIDs are the same as the given zone's TZID, then we know the timezones are the same so we return TRUE. */ retval = TRUE; } else { /* If the TZIDs differ, we have to compare the UTC offsets of the start and end times, using their own timezones and the given timezone. */ status = cal_client_get_timezone (client, start_datetime.tzid, &start_zone); if (status != CAL_CLIENT_GET_SUCCESS) goto out; offset1 = icaltimezone_get_utc_offset (start_zone, start_datetime.value, NULL); offset2 = icaltimezone_get_utc_offset (zone, start_datetime.value, NULL); if (offset1 == offset2) { status = cal_client_get_timezone (client, end_datetime.tzid, &end_zone); if (status != CAL_CLIENT_GET_SUCCESS) goto out; offset1 = icaltimezone_get_utc_offset (end_zone, end_datetime.value, NULL); offset2 = icaltimezone_get_utc_offset (zone, end_datetime.value, NULL); if (offset1 == offset2) retval = TRUE; } } out: cal_component_free_datetime (&start_datetime); cal_component_free_datetime (&end_datetime); return retval; } amer'>gstreamer FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
path: root/mbone
Commit message (Expand)AuthorAgeFilesLines
* Reset maintainer to ports@ due to maintainer's request -- he hasn'tlinimon2004-01-131-1/+1
* - Update to 2.99.1pav2004-01-0912-37/+189
* Add xspeakfree, a Tcl/Tk frontent to Speak Freely.pav2003-12-135-0/+56
* Mark as broken on 5.x due to the usual gcc3.3 bitrot.linimon2003-12-121-2/+8
* - Unbreak by adding dependency on makedepend.pav2003-11-211-0/+2
* Define USE_PERL5_BUILD, not erroneous USE_PERL.trevor2003-11-201-1/+1
* Define USE_PERL to make Perl available for (mostly deprecated)trevor2003-11-201-0/+1
* Add mcl 2.99,bms2003-11-1532-0/+560
* ports with possibly unreachable MAINTAINERsedwin2003-11-021-1/+1
* Move inclusion of bsd.port.pre.mk after definiton of all variables.linimon2003-10-295-24/+28
* Remove blank line to pacify portlint.linimon2003-10-221-1/+0
* Mark as broken on 5.x. Fix plist. Notified maintainer.linimon2003-10-222-2/+7
* Mark as broken on 5.x. The last distfile is from 1997. A google searchlinimon2003-10-221-2/+8
* Mark as broken on 5.x. The distfile is from 1997. While here, updatelinimon2003-10-222-1/+9
* Mark broken on 5.x. The distfile is from 1996 so updates might notlinimon2003-10-222-1/+9
* Make portlint(1) happy by changing strip to ${STRIP_CMD}osa2003-09-243-4/+4
* [PATCH] mbone/wb: enable choose of ghostscript interpreteredwin2003-08-311-1/+15
* Update to 7.6a.naddy2003-06-264-36/+43
* Undo an obsoleted patch to include <sys/soundcard.h> instead ofkris2003-05-101-3/+3
* Use -DAUDIO_BLOCKING. This should hopefully fix sfmike wedging and becomingadamw2003-03-241-1/+1
* Clear moonlight beckons.ade2003-03-0720-10/+10
* Remove RESTRICTED tag for crypto stuff.nork2003-02-232-3/+0
* De-pkg-comment.knu2003-02-214-2/+2
* De-pkg-comment.knu2003-02-214-2/+2
* Don't treat alpha specially with INT_64. INT_64 is not used consistentlyfenner2003-02-011-0/+15
* Make the struct huffentry public so that global variablesfenner2003-01-241-0/+16
* Use std::memset instead of just memsetfenner2003-01-241-0/+73
* Fix signal handler prototype to make newer g++ happyfenner2003-01-242-0/+18
* Build with tcl/tk 8.3fenner2003-01-242-37/+37
* Change of back-up location.orion2003-01-211-3/+3
* Partially fix build on sparc64 (Don't need to prototype inet_ntopkris2003-01-121-0/+13
* fix fetch for mbone/speak-freelyedwin2002-12-126-88/+54
* Fix fetcharved2002-12-111-1/+1
* Made mbone/rat compiling again (double patch-file)edwin2002-11-151-53/+0
* o Rollback PORTCOMMENT modifications while this feature's implementationlioux2002-11-114-4/+2
* Use PORTCOMMENT in the Makefile, and whack the pkg-comment.adamw2002-11-074-2/+4
* Change MAINTAINER to tmutoh@mx10.freecom.ne.jp.nork2002-10-271-1/+1
* Fix build on -current and respect CC and CFLAGSkris2002-10-215-72/+96
* MASTER_SITE moved. Upgrade still to do.fenner2002-10-081-1/+1
* Fix broken rtpmon build.fenner2002-09-303-12/+35
* Fix broken rqm port to work with more modern uclmmbasefenner2002-09-301-0/+18
* Fix build on -current (machine/soundcard.h -> sys/soundcard.h)kris2002-09-082-0/+22
* Update to version 4.2.22.orion2002-08-114-293/+8
* Bump PORTREVISION.jkoshy2002-06-131-0/+1
* Fix a bug that removes a startup problem with rtpmon, namely erroring outjkoshy2002-06-111-0/+10
* machine/soundcard.h -> sys/soundcard.hpetef2002-06-071-0/+5
* Support IPv6.sumikawa2002-03-244-2/+81
* Sync to rat-4.2.20.orion2002-02-259-168/+305
* Fix MASTER_SITES and remove redundant distinfo entrypat2002-02-082-2/+1
* Fix for autoconfpat2002-01-271-2/+2
* Fix for -CURRENT, malloc.h->stdlib.hpat2002-01-021-0/+4
* Set LATEST_LINK to rat30.knu2001-11-071-0/+2
* Sort entries and remove a duplicate "rqm".knu2001-09-211-2/+1
* Replace the ghostscript55 dependencies with ghostscript-gnu.knu2001-09-121-1/+1
* Make nte initialize TCL properly.fenner2001-08-021-0/+16
* Update to vic 2.8ucl-1.1.3fenner2001-08-0230-3415/+149
* New port for multicast AV tool.kiri2001-06-079-0/+113
* New port for RAT(network audio tool) version 3.kiri2001-06-0710-0/+199
* wb compatible open source shared whiteboard programassar2001-05-127-0/+90
* Update to rtptools 1.17fenner2001-04-225-52/+54
* Remove patch-agmharo2001-04-061-13/+0
* Fix buildmharo2001-04-062-10/+59
* Correct reversed patchmharo2001-04-061-4/+4
* Remove empty filemharo2001-04-06