aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-date-time-list.c
diff options
context:
space:
mode:
authorHarry Lu <harry.lu@sun.com>2003-07-09 16:20:57 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-07-09 16:20:57 +0800
commita82c55f31d763b471cce7fff76d7d2365d16bf6b (patch)
tree9792890ab49b96549dc4da79598608da9ac6a4bd /calendar/gui/e-date-time-list.c
parentcc5771c655c3ea77a8821e1687fceb2d26003795 (diff)
downloadgsoc2013-evolution-a82c55f31d763b471cce7fff76d7d2365d16bf6b.tar
gsoc2013-evolution-a82c55f31d763b471cce7fff76d7d2365d16bf6b.tar.gz
gsoc2013-evolution-a82c55f31d763b471cce7fff76d7d2365d16bf6b.tar.bz2
gsoc2013-evolution-a82c55f31d763b471cce7fff76d7d2365d16bf6b.tar.lz
gsoc2013-evolution-a82c55f31d763b471cce7fff76d7d2365d16bf6b.tar.xz
gsoc2013-evolution-a82c55f31d763b471cce7fff76d7d2365d16bf6b.tar.zst
gsoc2013-evolution-a82c55f31d763b471cce7fff76d7d2365d16bf6b.zip
Fixes #46075.
2003-07-10 Harry Lu <harry.lu@sun.com> Fixes #46075. * gui/e-date-time-list.c (compare_datetime): new function to compare two CalComponentDateTime instances. (e_date_time_list_append): check whether the date already exists before adding it to the list. svn path=/trunk/; revision=21767
Diffstat (limited to 'calendar/gui/e-date-time-list.c')
-rw-r--r--calendar/gui/e-date-time-list.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/calendar/gui/e-date-time-list.c b/calendar/gui/e-date-time-list.c
index 13bfc6df28..6a6848fc25 100644
--- a/calendar/gui/e-date-time-list.c
+++ b/calendar/gui/e-date-time-list.c
@@ -291,6 +291,12 @@ copy_datetime (const CalComponentDateTime *datetime)
return datetime_copy;
}
+static gint
+compare_datetime (const CalComponentDateTime *datetime1, const CalComponentDateTime *datetime2)
+{
+ return icaltime_compare (*datetime1->value, *datetime2->value);
+}
+
void
e_date_time_list_set_date_time (EDateTimeList *date_time_list, GtkTreeIter *iter,
const CalComponentDateTime *datetime)
@@ -311,8 +317,10 @@ e_date_time_list_append (EDateTimeList *date_time_list, GtkTreeIter *iter,
{
g_return_if_fail (datetime != NULL);
- date_time_list->list = g_list_append (date_time_list->list, copy_datetime (datetime));
- row_added (date_time_list, g_list_length (date_time_list->list) - 1);
+ if (g_list_find_custom (date_time_list->list, datetime, (GCompareFunc)compare_datetime) == NULL) {
+ date_time_list->list = g_list_append (date_time_list->list, copy_datetime (datetime));
+ row_added (date_time_list, g_list_length (date_time_list->list) - 1);
+ }
if (iter) {
iter->user_data = g_list_last (date_time_list->list);