aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-09-17 13:56:16 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-09-17 13:56:16 +0800
commitd99aeae7edf0e639c866389d537ea33a11b3cd45 (patch)
tree5ed41294bcdd51ac63d9512025876c1c89f25680 /calendar/cal-util
parent169d9ae19a0eb165edc757eca753a757a02f60f7 (diff)
downloadgsoc2013-evolution-d99aeae7edf0e639c866389d537ea33a11b3cd45.tar
gsoc2013-evolution-d99aeae7edf0e639c866389d537ea33a11b3cd45.tar.gz
gsoc2013-evolution-d99aeae7edf0e639c866389d537ea33a11b3cd45.tar.bz2
gsoc2013-evolution-d99aeae7edf0e639c866389d537ea33a11b3cd45.tar.lz
gsoc2013-evolution-d99aeae7edf0e639c866389d537ea33a11b3cd45.tar.xz
gsoc2013-evolution-d99aeae7edf0e639c866389d537ea33a11b3cd45.tar.zst
gsoc2013-evolution-d99aeae7edf0e639c866389d537ea33a11b3cd45.zip
for each call back, removes the alarms (cal_component_remove_all_alarms):
2001-09-17 JP Rosevear <jpr@ximian.com> * cal-util/cal-component.c (for_each_remove_all_alarms): for each call back, removes the alarms (cal_component_remove_all_alarms): remove all alarms from the component * cal-util/cal-component.h: new proto * gui/e-itip-control.c (write_error_html): writes error messages rather than normal html * gui/itip-utils.c (itip_send_comp): remove all alarms if the method warrants it svn path=/trunk/; revision=12897
Diffstat (limited to 'calendar/cal-util')
-rw-r--r--calendar/cal-util/cal-component.c35
-rw-r--r--calendar/cal-util/cal-component.h1
2 files changed, 36 insertions, 0 deletions
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c
index 7ef6f9e477..b4784c6124 100644
--- a/calendar/cal-util/cal-component.c
+++ b/calendar/cal-util/cal-component.c
@@ -4066,6 +4066,41 @@ cal_component_remove_alarm (CalComponent *comp, const char *auid)
icalcomponent_free (alarm);
}
+static gboolean
+for_each_remove_all_alarms (gpointer key, gpointer value, gpointer data)
+{
+ CalComponent *comp = CAL_COMPONENT (data);
+ CalComponentPrivate *priv;
+ icalcomponent *alarm = value;
+
+ priv = comp->priv;
+
+ icalcomponent_remove_component (priv->icalcomp, alarm);
+ icalcomponent_free (alarm);
+
+ return TRUE;
+}
+
+/**
+ * cal_component_remove_all_alarms:
+ * @comp: A calendar component
+ *
+ * Remove all alarms from the calendar component
+ **/
+void
+cal_component_remove_all_alarms (CalComponent *comp)
+{
+ CalComponentPrivate *priv;
+
+ g_return_if_fail (comp != NULL);
+ g_return_if_fail (IS_CAL_COMPONENT (comp));
+
+ priv = comp->priv;
+ g_return_if_fail (priv->icalcomp != NULL);
+
+ g_hash_table_foreach_remove (priv->alarm_uid_hash, for_each_remove_all_alarms, comp);
+}
+
/* Scans an icalproperty from a calendar component and adds its mapping to our
* own alarm structure.
diff --git a/calendar/cal-util/cal-component.h b/calendar/cal-util/cal-component.h
index 1ab8ee24bd..801cdc51f0 100644
--- a/calendar/cal-util/cal-component.h
+++ b/calendar/cal-util/cal-component.h
@@ -394,6 +394,7 @@ typedef struct {
gboolean cal_component_has_alarms (CalComponent *comp);
void cal_component_add_alarm (CalComponent *comp, CalComponentAlarm *alarm);
void cal_component_remove_alarm (CalComponent *comp, const char *auid);
+void cal_component_remove_all_alarms (CalComponent *comp);
GList *cal_component_get_alarm_uids (CalComponent *comp);
CalComponentAlarm *cal_component_get_alarm (CalComponent *comp, const char *auid);