aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/cal-util')
-rw-r--r--calendar/cal-util/cal-component.c26
-rw-r--r--calendar/cal-util/cal-component.h4
-rw-r--r--calendar/cal-util/timeutil.h2
3 files changed, 16 insertions, 16 deletions
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c
index 4aafdbf13a..cc920c19c6 100644
--- a/calendar/cal-util/cal-component.c
+++ b/calendar/cal-util/cal-component.c
@@ -607,7 +607,7 @@ scan_property (CalComponent *comp, icalproperty *prop)
static const char *
alarm_uid_from_prop (icalproperty *prop)
{
- char *xstr;
+ const char *xstr;
g_assert (icalproperty_isa (prop) == ICAL_X_PROPERTY);
@@ -1129,12 +1129,13 @@ cal_component_set_uid (CalComponent *comp, const char *uid)
/**
* cal_component_get_status:
* @comp: A calendar component object.
- * @status: Return value for the status string.
+ * @status: Return value for the status value. It is set to #ICAL_STATUS_NONE
+ * if the component has no status property.
*
* Queries the status property of a calendar component object.
**/
void
-cal_component_get_status (CalComponent *comp, const char **status)
+cal_component_get_status (CalComponent *comp, icalproperty_status *status)
{
CalComponentPrivate *priv;
@@ -1146,7 +1147,7 @@ cal_component_get_status (CalComponent *comp, const char **status)
g_return_if_fail (priv->icalcomp != NULL);
if (!priv->status) {
- *status = NULL;
+ *status = ICAL_STATUS_NONE;
return;
}
@@ -1156,25 +1157,25 @@ cal_component_get_status (CalComponent *comp, const char **status)
/**
* cal_component_set_status:
* @comp: A calendar component object.
- * @status: a status string, e.g. "IN-PROCESS", "NEEDS-ACTION". See the RFC.
+ * @status: Status value. You should use #ICAL_STATUS_NONE if you want to unset
+ * this property.
*
- * Sets the status string property of a calendar component object.
+ * Sets the status property of a calendar component object.
**/
void
-cal_component_set_status (CalComponent *comp, const char *status)
+cal_component_set_status (CalComponent *comp, icalproperty_status status)
{
CalComponentPrivate *priv;
g_return_if_fail (comp != NULL);
g_return_if_fail (IS_CAL_COMPONENT (comp));
- g_return_if_fail (status != NULL);
priv = comp->priv;
g_return_if_fail (priv->icalcomp != NULL);
priv->need_sequence_inc = TRUE;
- if (status == NULL) {
+ if (status == ICAL_STATUS_NONE) {
if (priv->status) {
icalcomponent_remove_property (priv->icalcomp, priv->status);
icalproperty_free (priv->status);
@@ -1185,11 +1186,10 @@ cal_component_set_status (CalComponent *comp, const char *status)
}
if (priv->status) {
- icalproperty_set_status (priv->status, (char *) status);
+ icalproperty_set_status (priv->status, status);
} else {
- priv->status = icalproperty_new_status ((char *) status);
- icalcomponent_add_property (priv->icalcomp,
- priv->status);
+ priv->status = icalproperty_new_status (status);
+ icalcomponent_add_property (priv->icalcomp, priv->status);
}
}
diff --git a/calendar/cal-util/cal-component.h b/calendar/cal-util/cal-component.h
index eb4b129f17..f59bb33a7b 100644
--- a/calendar/cal-util/cal-component.h
+++ b/calendar/cal-util/cal-component.h
@@ -165,8 +165,8 @@ void cal_component_commit_sequence (CalComponent *comp);
void cal_component_get_uid (CalComponent *comp, const char **uid);
void cal_component_set_uid (CalComponent *comp, const char *uid);
-void cal_component_get_status (CalComponent *comp, const char **status);
-void cal_component_set_status (CalComponent *comp, const char *status);
+void cal_component_get_status (CalComponent *comp, icalproperty_status *status);
+void cal_component_set_status (CalComponent *comp, icalproperty_status status);
void cal_component_get_categories_list (CalComponent *comp, GSList **categ_list);
void cal_component_set_categories_list (CalComponent *comp, GSList *categ_list);
diff --git a/calendar/cal-util/timeutil.h b/calendar/cal-util/timeutil.h
index b8fa6400d2..11bfcceb05 100644
--- a/calendar/cal-util/timeutil.h
+++ b/calendar/cal-util/timeutil.h
@@ -11,7 +11,7 @@
#include <time.h>
-#include <icaltypes.h>
+#include <ical.h>
time_t time_from_isodate (char *str);