aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorHans Petter <hansp@src.gnome.org>2003-09-12 06:04:44 +0800
committerHans Petter <hansp@src.gnome.org>2003-09-12 06:04:44 +0800
commit697761cc337aa77a47140c8df50ed84bc25e23f6 (patch)
treeb785830f72e9938cceaa016a419c7b6d9892bada /calendar
parent733d77e657516f9a59b5c1a7b62acb87b03ec86f (diff)
downloadgsoc2013-evolution-697761cc337aa77a47140c8df50ed84bc25e23f6.tar
gsoc2013-evolution-697761cc337aa77a47140c8df50ed84bc25e23f6.tar.gz
gsoc2013-evolution-697761cc337aa77a47140c8df50ed84bc25e23f6.tar.bz2
gsoc2013-evolution-697761cc337aa77a47140c8df50ed84bc25e23f6.tar.lz
gsoc2013-evolution-697761cc337aa77a47140c8df50ed84bc25e23f6.tar.xz
gsoc2013-evolution-697761cc337aa77a47140c8df50ed84bc25e23f6.tar.zst
gsoc2013-evolution-697761cc337aa77a47140c8df50ed84bc25e23f6.zip
Import new libical from mainline HEAD and make appropriate changes to
Evolution. svn path=/trunk/; revision=22538
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog33
-rw-r--r--calendar/cal-util/Makefile.am4
-rw-r--r--calendar/cal-util/cal-component.c87
-rw-r--r--calendar/cal-util/cal-util.c10
-rw-r--r--calendar/gui/e-cal-model-calendar.c20
-rw-r--r--calendar/gui/e-cal-model-tasks.c6
-rw-r--r--calendar/gui/e-cal-model.c17
-rw-r--r--calendar/importers/Makefile.am6
-rw-r--r--calendar/pcs/cal-backend-file.c6
9 files changed, 129 insertions, 60 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index a8c0b7b8bb..1113f7ea5d 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,36 @@
+2003-09-11 Hans Petter Jansson <hpj@ximian.com>
+
+ * cal-util/Makefile.am (libcal_util_la_LIBADD):
+ libical-evolution.la -> libical.la
+
+ * cal-util/cal-component.c (cal_component_get_classification)
+ (cal_component_set_classification)
+ (get_text_list)
+ (get_icaltimetype)
+ (get_datetime)
+ (get_period_list)
+ (get_recur_list)
+ (cal_component_get_transparency)
+ (cal_component_set_transparency): Adapt to new libical.
+
+ * cal-util/cal-util.c (cal_util_event_dates_match): Ditto.
+
+ * pcs/cal-backend-file.c (create_user_free_busy): Ditto.
+
+ * gui/e-cal-model-tasks.c (get_completed)
+ (get_due)
+ (get_due_status): Ditto.
+
+ * gui/e-cal-model.c (get_dtstart)
+ (set_classification): Ditto.
+
+ * gui/e-cal-model-calendar.c (get_dtend)
+ (get_transparency)
+ (set_transparency): Adapt to new libical and fix a comparison bug.
+
+ * importers/Makefile.am (libevolution_calendar_importers_la_LIBADD):
+ libical-evolution.la -> libical.la
+
2003-09-11 Dan Winship <danw@ximian.com>
* cal-util/Makefile.am (privlib_LTLIBRARIES): Remove
diff --git a/calendar/cal-util/Makefile.am b/calendar/cal-util/Makefile.am
index 004946bdbf..d070271c0b 100644
--- a/calendar/cal-util/Makefile.am
+++ b/calendar/cal-util/Makefile.am
@@ -26,7 +26,7 @@ libcal_util_la_SOURCES = \
timeutil.c
libcal_util_la_LIBADD = \
- $(top_builddir)/libical/src/libical/libical-evolution.la
+ $(top_builddir)/libical/src/libical/libical.la
libcal_utilincludedir = $(privincludedir)/cal-util
@@ -50,4 +50,4 @@ test_recur_LDADD = \
$(EVOLUTION_CALENDAR_LIBS)
EXTRA_DIST = \
- cal-util-marshal.list \ No newline at end of file
+ cal-util-marshal.list
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c
index 671af4a9ec..22b9ee310f 100644
--- a/calendar/cal-util/cal-component.c
+++ b/calendar/cal-util/cal-component.c
@@ -1536,7 +1536,7 @@ void
cal_component_get_classification (CalComponent *comp, CalComponentClassification *classif)
{
CalComponentPrivate *priv;
- const char *class;
+ icalproperty_class class;
g_return_if_fail (comp != NULL);
g_return_if_fail (IS_CAL_COMPONENT (comp));
@@ -1552,14 +1552,21 @@ cal_component_get_classification (CalComponent *comp, CalComponentClassification
class = icalproperty_get_class (priv->classification);
- if (strcasecmp (class, "PUBLIC") == 0)
- *classif = CAL_COMPONENT_CLASS_PUBLIC;
- else if (strcasecmp (class, "PRIVATE") == 0)
- *classif = CAL_COMPONENT_CLASS_PRIVATE;
- else if (strcasecmp (class, "CONFIDENTIAL") == 0)
- *classif = CAL_COMPONENT_CLASS_CONFIDENTIAL;
- else
- *classif = CAL_COMPONENT_CLASS_UNKNOWN;
+ switch (class)
+ {
+ case ICAL_CLASS_PUBLIC:
+ *classif = CAL_COMPONENT_CLASS_PUBLIC;
+ break;
+ case ICAL_CLASS_PRIVATE:
+ *classif = CAL_COMPONENT_CLASS_PRIVATE;
+ break;
+ case ICAL_CLASS_CONFIDENTIAL:
+ *classif = CAL_COMPONENT_CLASS_CONFIDENTIAL;
+ break;
+ default:
+ *classif = CAL_COMPONENT_CLASS_UNKNOWN;
+ break;
+ }
}
/**
@@ -1574,7 +1581,7 @@ void
cal_component_set_classification (CalComponent *comp, CalComponentClassification classif)
{
CalComponentPrivate *priv;
- char *str;
+ icalproperty_class class;
g_return_if_fail (comp != NULL);
g_return_if_fail (IS_CAL_COMPONENT (comp));
@@ -1595,26 +1602,26 @@ cal_component_set_classification (CalComponent *comp, CalComponentClassification
switch (classif) {
case CAL_COMPONENT_CLASS_PUBLIC:
- str = "PUBLIC";
+ class = ICAL_CLASS_PUBLIC;
break;
case CAL_COMPONENT_CLASS_PRIVATE:
- str = "PRIVATE";
+ class = ICAL_CLASS_PRIVATE;
break;
case CAL_COMPONENT_CLASS_CONFIDENTIAL:
- str = "CONFIDENTIAL";
+ class = ICAL_CLASS_CONFIDENTIAL;
break;
default:
g_assert_not_reached ();
- str = NULL;
+ class = ICAL_CLASS_NONE;
}
if (priv->classification)
- icalproperty_set_class (priv->classification, str);
+ icalproperty_set_class (priv->classification, class);
else {
- priv->classification = icalproperty_new_class (str);
+ priv->classification = icalproperty_new_class (class);
icalcomponent_add_property (priv->icalcomp, priv->classification);
}
}
@@ -1622,7 +1629,7 @@ cal_component_set_classification (CalComponent *comp, CalComponentClassification
/* Gets a text list value */
static void
get_text_list (GSList *text_list,
- const char *(* get_prop_func) (icalproperty *prop),
+ const char *(* get_prop_func) (const icalproperty *prop),
GSList **tl)
{
GSList *l;
@@ -1808,7 +1815,7 @@ cal_component_set_contact_list (CalComponent *comp, GSList *text_list)
/* Gets a struct icaltimetype value */
static void
get_icaltimetype (icalproperty *prop,
- struct icaltimetype (* get_prop_func) (icalproperty *prop),
+ struct icaltimetype (* get_prop_func) (const icalproperty *prop),
struct icaltimetype **t)
{
if (!prop) {
@@ -2001,7 +2008,7 @@ cal_component_set_description_list (CalComponent *comp, GSList *text_list)
/* Gets a date/time and timezone pair */
static void
get_datetime (struct datetime *datetime,
- struct icaltimetype (* get_prop_func) (icalproperty *prop),
+ struct icaltimetype (* get_prop_func) (const icalproperty *prop),
CalComponentDateTime *dt)
{
if (datetime->prop) {
@@ -2353,7 +2360,7 @@ cal_component_set_due (CalComponent *comp, CalComponentDateTime *dt)
/* Builds a list of CalComponentPeriod structures based on a list of icalproperties */
static void
get_period_list (GSList *period_list,
- struct icaldatetimeperiodtype (* get_prop_func) (icalproperty *prop),
+ struct icaldatetimeperiodtype (* get_prop_func) (const icalproperty *prop),
GSList **list)
{
GSList *l;
@@ -2620,7 +2627,7 @@ cal_component_has_exdates (CalComponent *comp)
/* Gets a list of recurrence rules */
static void
get_recur_list (GSList *recur_list,
- struct icalrecurrencetype (* get_prop_func) (icalproperty *prop),
+ struct icalrecurrencetype (* get_prop_func) (const icalproperty *prop),
GSList **list)
{
GSList *l;
@@ -3843,7 +3850,7 @@ void
cal_component_get_transparency (CalComponent *comp, CalComponentTransparency *transp)
{
CalComponentPrivate *priv;
- const char *val;
+ icalproperty_transp ical_transp;
g_return_if_fail (comp != NULL);
g_return_if_fail (IS_CAL_COMPONENT (comp));
@@ -3857,14 +3864,24 @@ cal_component_get_transparency (CalComponent *comp, CalComponentTransparency *tr
return;
}
- val = icalproperty_get_transp (priv->transparency);
+ ical_transp = icalproperty_get_transp (priv->transparency);
- if (strcasecmp (val, "TRANSPARENT") == 0)
- *transp = CAL_COMPONENT_TRANSP_TRANSPARENT;
- else if (strcasecmp (val, "OPAQUE") == 0)
- *transp = CAL_COMPONENT_TRANSP_OPAQUE;
- else
- *transp = CAL_COMPONENT_TRANSP_UNKNOWN;
+ switch (ical_transp)
+ {
+ case ICAL_TRANSP_TRANSPARENT:
+ case ICAL_TRANSP_TRANSPARENTNOCONFLICT:
+ *transp = CAL_COMPONENT_TRANSP_TRANSPARENT;
+ break;
+
+ case ICAL_TRANSP_OPAQUE:
+ case ICAL_TRANSP_OPAQUENOCONFLICT:
+ *transp = CAL_COMPONENT_TRANSP_OPAQUE;
+ break;
+
+ default:
+ *transp = CAL_COMPONENT_TRANSP_UNKNOWN;
+ break;
+ }
}
/**
@@ -3878,7 +3895,7 @@ void
cal_component_set_transparency (CalComponent *comp, CalComponentTransparency transp)
{
CalComponentPrivate *priv;
- char *str;
+ icalproperty_transp ical_transp;
g_return_if_fail (comp != NULL);
g_return_if_fail (IS_CAL_COMPONENT (comp));
@@ -3900,22 +3917,22 @@ cal_component_set_transparency (CalComponent *comp, CalComponentTransparency tra
switch (transp) {
case CAL_COMPONENT_TRANSP_TRANSPARENT:
- str = "TRANSPARENT";
+ ical_transp = ICAL_TRANSP_TRANSPARENT;
break;
case CAL_COMPONENT_TRANSP_OPAQUE:
- str = "OPAQUE";
+ ical_transp = ICAL_TRANSP_OPAQUE;
break;
default:
g_assert_not_reached ();
- str = NULL;
+ ical_transp = ICAL_TRANSP_NONE;
}
if (priv->transparency)
- icalproperty_set_transp (priv->transparency, str);
+ icalproperty_set_transp (priv->transparency, ical_transp);
else {
- priv->transparency = icalproperty_new_transp (str);
+ priv->transparency = icalproperty_new_transp (ical_transp);
icalcomponent_add_property (priv->icalcomp, priv->transparency);
}
}
diff --git a/calendar/cal-util/cal-util.c b/calendar/cal-util/cal-util.c
index 690bb57f6f..1e03c86d75 100644
--- a/calendar/cal-util/cal-util.c
+++ b/calendar/cal-util/cal-util.c
@@ -755,13 +755,19 @@ cal_util_event_dates_match (icalcomponent *icalcomp1, icalcomponent *icalcomp2)
return FALSE;
}
+
+
/* now match the timezones */
if (!(!c1_dtstart.zone && !c2_dtstart.zone) ||
- (c1_dtstart.zone && c2_dtstart.zone && !strcmp (c1_dtstart.zone, c2_dtstart.zone)))
+ (c1_dtstart.zone && c2_dtstart.zone &&
+ !strcmp (icaltimezone_get_tzid ((icaltimezone *) c1_dtstart.zone),
+ icaltimezone_get_tzid ((icaltimezone *) c2_dtstart.zone))))
return FALSE;
if (!(!c1_dtend.zone && !c2_dtend.zone) ||
- (c1_dtend.zone && c2_dtend.zone && !strcmp (c1_dtend.zone, c2_dtend.zone)))
+ (c1_dtend.zone && c2_dtend.zone &&
+ !strcmp (icaltimezone_get_tzid ((icaltimezone *) c1_dtend.zone),
+ icaltimezone_get_tzid ((icaltimezone *) c2_dtend.zone))))
return FALSE;
return TRUE;
diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c
index 73ecaf3e94..82de4e6d5a 100644
--- a/calendar/gui/e-cal-model-calendar.c
+++ b/calendar/gui/e-cal-model-calendar.c
@@ -128,7 +128,7 @@ get_dtend (ECalModelComponent *comp_data)
/* FIXME: handle errors */
cal_client_get_timezone (comp_data->client,
- icaltimezone_get_tzid (icaltimezone_get_builtin_timezone (tt_end.zone)),
+ icaltime_get_tzid (tt_end),
&zone);
comp_data->dtend->zone = zone;
}
@@ -155,12 +155,14 @@ get_transparency (ECalModelComponent *comp_data)
prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_TRANSP_PROPERTY);
if (prop) {
- const char *transp;
+ icalproperty_transp transp;
transp = icalproperty_get_transp (prop);
- if (strcasecmp (transp, "TRANSPARENT") == 0)
+ if (transp == ICAL_TRANSP_TRANSPARENT ||
+ transp == ICAL_TRANSP_TRANSPARENTNOCONFLICT)
return _("Free");
- else if (strcasecmp (transp, "OPAQUE") == 0)
+ else if (transp == ICAL_TRANSP_OPAQUE ||
+ transp == ICAL_TRANSP_OPAQUENOCONFLICT)
return _("Busy");
}
@@ -251,12 +253,12 @@ set_transparency (ECalModelComponent *comp_data, const void *value)
icalproperty_free (prop);
}
} else {
- const char *transp;
+ icalproperty_transp transp;
- if (strcasecmp (value, "FREE"))
- transp = "TRANSPARENT";
- else if (strcasecmp (value, "OPAQUE"))
- transp = "OPAQUE";
+ if (!strcasecmp (value, "FREE"))
+ transp = ICAL_TRANSP_TRANSPARENT;
+ else if (!strcasecmp (value, "OPAQUE"))
+ transp = ICAL_TRANSP_OPAQUE;
else {
if (prop) {
icalcomponent_remove_property (comp_data->icalcomp, prop);
diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c
index deeb341512..6bca52586c 100644
--- a/calendar/gui/e-cal-model-tasks.c
+++ b/calendar/gui/e-cal-model-tasks.c
@@ -222,7 +222,7 @@ get_completed (ECalModelComponent *comp_data)
/* FIXME: handle errors */
cal_client_get_timezone (comp_data->client,
- icaltimezone_get_tzid (icaltimezone_get_builtin_timezone (tt_completed.zone)),
+ icaltime_get_tzid (tt_completed),
&zone);
comp_data->completed->zone = zone;
}
@@ -252,7 +252,7 @@ get_due (ECalModelComponent *comp_data)
/* FIXME: handle errors */
cal_client_get_timezone (comp_data->client,
- icaltimezone_get_tzid (icaltimezone_get_builtin_timezone (tt_due.zone)),
+ icaltime_get_tzid (tt_due),
&zone);
comp_data->due->zone = zone;
}
@@ -398,7 +398,7 @@ get_due_status (ECalModelTasks *model, ECalModelComponent *comp_data)
} else {
/* Get the current time in the same timezone as the DUE date.*/
status = cal_client_get_timezone (comp_data->client,
- icaltimezone_get_tzid (icaltimezone_get_builtin_timezone (due_tt.zone)),
+ icaltime_get_tzid (due_tt),
&zone);
if (status != CAL_CLIENT_GET_SUCCESS)
return E_CAL_MODEL_TASKS_DUE_FUTURE;
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 1f2e4a8f13..8a68cd07e5 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -336,7 +336,7 @@ get_dtstart (ECalModel *model, ECalModelComponent *comp_data)
/* FIXME: handle errors */
cal_client_get_timezone (comp_data->client,
- icaltimezone_get_tzid (icaltimezone_get_builtin_timezone (tt_start.zone)),
+ icaltime_get_tzid (tt_start),
&zone);
comp_data->dtstart->zone = zone;
}
@@ -476,11 +476,22 @@ set_classification (ECalModelComponent *comp_data, const char *value)
icalproperty_free (prop);
}
} else {
+ icalproperty_class ical_class;
+
+ if (!strcasecmp (value, "PUBLIC"))
+ ical_class = ICAL_CLASS_PUBLIC;
+ else if (!strcasecmp (value, "PRIVATE"))
+ ical_class = ICAL_CLASS_PRIVATE;
+ else if (!strcasecmp (value, "CONFIDENTIAL"))
+ ical_class = ICAL_CLASS_CONFIDENTIAL;
+ else
+ ical_class = ICAL_CLASS_NONE;
+
if (!prop) {
- prop = icalproperty_new_class (value);
+ prop = icalproperty_new_class (ical_class);
icalcomponent_add_property (comp_data->icalcomp, prop);
} else
- icalproperty_set_class (prop, value);
+ icalproperty_set_class (prop, ical_class);
}
}
diff --git a/calendar/importers/Makefile.am b/calendar/importers/Makefile.am
index 5f82341223..a1487c64a5 100644
--- a/calendar/importers/Makefile.am
+++ b/calendar/importers/Makefile.am
@@ -29,7 +29,7 @@ libevolution_calendar_importers_la_LDFLAGS = -avoid-version -module
libevolution_calendar_importers_la_LIBADD = \
$(top_builddir)/shell/importer/libevolution-importer.la \
- $(top_builddir)/libical/src/libicalvcal/libicalvcal-evolution.la \
+ $(top_builddir)/libical/src/libicalvcal/libicalvcal.la \
$(IMPORTERS_LIBS)
# evolution_calendar_importer_SOURCES = \
@@ -43,8 +43,8 @@ libevolution_calendar_importers_la_LIBADD = \
# $(top_builddir)/calendar/cal-util/libcal-util.la \
# $(top_builddir)/calendar/cal-client/libcal-client.la \
# $(top_builddir)/libwombat/libwombat.la \
-# $(top_builddir)/libical/src/libical/libical-evolution.la \
-# $(top_builddir)/libical/src/libicalvcal/libicalvcal-evolution.la \
+# $(top_builddir)/libical/src/libical/libical.la \
+# $(top_builddir)/libical/src/libicalvcal/libicalvcal.la \
# $(EVOLUTION_CALENDAR_LIBS)
server_in_files = GNOME_Evolution_Calendar_Importer.server.in.in
diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c
index 81697602d4..b26f2fd74c 100644
--- a/calendar/pcs/cal-backend-file.c
+++ b/calendar/pcs/cal-backend-file.c
@@ -1203,9 +1203,9 @@ create_user_free_busy (CalBackendFile *cbfile, const char *address, const char *
prop = icalcomponent_get_first_property (icalcomp,
ICAL_TRANSP_PROPERTY);
if (prop) {
- const char *transp_val = icalproperty_get_transp (prop);
- if (transp_val
- && !strcasecmp (transp_val, "TRANSPARENT"))
+ icalproperty_transp transp_val = icalproperty_get_transp (prop);
+ if (transp_val == ICAL_TRANSP_TRANSPARENT ||
+ transp_val == ICAL_TRANSP_TRANSPARENTNOCONFLICT)
continue;
}