diff options
author | JP Rosevear <jpr@src.gnome.org> | 2003-03-05 03:52:37 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2003-03-05 03:52:37 +0800 |
commit | 6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62 (patch) | |
tree | bba07b5f28966c10a90de8f550af895014b0b9bb /calendar/cal-util/cal-util.c | |
parent | cd4477930e72b1be069d5c97b90d96e989645bfc (diff) | |
download | gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar.gz gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar.zst gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.zip |
If only the pipe wouldn't break.
svn path=/trunk/; revision=20143
Diffstat (limited to 'calendar/cal-util/cal-util.c')
-rw-r--r-- | calendar/cal-util/cal-util.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/calendar/cal-util/cal-util.c b/calendar/cal-util/cal-util.c index 9730bfdbc2..040e322cce 100644 --- a/calendar/cal-util/cal-util.c +++ b/calendar/cal-util/cal-util.c @@ -177,7 +177,8 @@ struct alarm_occurrence_data { GList *alarm_uids; time_t start; time_t end; - + CalAlarmAction *omit; + /* This is what we compute */ GSList *triggers; int n_triggers; @@ -213,20 +214,30 @@ add_alarm_occurrences_cb (CalComponent *comp, time_t start, time_t end, gpointer for (l = aod->alarm_uids; l; l = l->next) { const char *auid; CalComponentAlarm *alarm; + CalAlarmAction action; CalAlarmTrigger trigger; CalAlarmRepeat repeat; struct icaldurationtype *dur; time_t dur_time; time_t occur_time, trigger_time; - + int i; + auid = l->data; alarm = cal_component_get_alarm (comp, auid); g_assert (alarm != NULL); + cal_component_alarm_get_action (alarm, &action); cal_component_alarm_get_trigger (alarm, &trigger); cal_component_alarm_get_repeat (alarm, &repeat); cal_component_alarm_free (alarm); + for (i = 0; aod->omit[i] != -1; i++) { + if (aod->omit[i] == action) + break; + } + if (aod->omit[i] != -1) + continue; + if (trigger.type != CAL_ALARM_TRIGGER_RELATIVE_START && trigger.type != CAL_ALARM_TRIGGER_RELATIVE_END) continue; @@ -290,20 +301,30 @@ generate_absolute_triggers (CalComponent *comp, struct alarm_occurrence_data *ao for (l = aod->alarm_uids; l; l = l->next) { const char *auid; CalComponentAlarm *alarm; + CalAlarmAction action; CalAlarmRepeat repeat; CalAlarmTrigger trigger; time_t abs_time; time_t occur_start, occur_end; icaltimezone *zone; - + int i; + auid = l->data; alarm = cal_component_get_alarm (comp, auid); g_assert (alarm != NULL); + cal_component_alarm_get_action (alarm, &action); cal_component_alarm_get_trigger (alarm, &trigger); cal_component_alarm_get_repeat (alarm, &repeat); cal_component_alarm_free (alarm); + for (i = 0; aod->omit[i] != -1; i++) { + if (aod->omit[i] == action) + break; + } + if (aod->omit[i] != -1) + continue; + if (trigger.type != CAL_ALARM_TRIGGER_ABSOLUTE) continue; @@ -397,6 +418,7 @@ CalComponentAlarms * cal_util_generate_alarms_for_comp (CalComponent *comp, time_t start, time_t end, + CalAlarmAction *omit, CalRecurResolveTimezoneFn resolve_tzid, gpointer user_data, icaltimezone *default_timezone) @@ -415,6 +437,7 @@ cal_util_generate_alarms_for_comp (CalComponent *comp, aod.alarm_uids = alarm_uids; aod.start = start; aod.end = end; + aod.omit = omit; aod.triggers = NULL; aod.n_triggers = 0; @@ -459,6 +482,7 @@ int cal_util_generate_alarms_for_list (GList *comps, time_t start, time_t end, + CalAlarmAction *omit, GSList **comp_alarms, CalRecurResolveTimezoneFn resolve_tzid, gpointer user_data, @@ -474,7 +498,7 @@ cal_util_generate_alarms_for_list (GList *comps, CalComponentAlarms *alarms; comp = CAL_COMPONENT (l->data); - alarms = cal_util_generate_alarms_for_comp (comp, start, end, resolve_tzid, user_data, default_timezone); + alarms = cal_util_generate_alarms_for_comp (comp, start, end, omit, resolve_tzid, user_data, default_timezone); if (alarms) { *comp_alarms = g_slist_prepend (*comp_alarms, alarms); |