[evolution-patches] Patch for 46075
- From: Harry Lu <harry lu sun com>
- To: evolution-patches <evolution-patches ximian com>
- Subject: [evolution-patches] Patch for 46075
- Date: Thu, 10 Jul 2003 17:07:36 +0800
Calendar developers,
Please review my patch for 46075.
Thanks!
Harry
Index: evolution/calendar//ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1815
diff -u -r1.1815 ChangeLog
--- evolution/calendar//ChangeLog 4 Jul 2003 10:36:23 -0000 1.1815
+++ evolution/calendar//ChangeLog 10 Jul 2003 08:50:15 -0000
@@ -1,3 +1,12 @@
+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.
+
2003-07-03 Rodrigo Moya <rodrigo ximian com>
* gui/e-tasks.c (setup_widgets): added a paned widget to contain
Index: evolution/calendar//gui/e-date-time-list.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-date-time-list.c,v
retrieving revision 1.2
diff -u -r1.2 e-date-time-list.c
--- evolution/calendar//gui/e-date-time-list.c 6 Feb 2003 01:58:30 -0000 1.2
+++ evolution/calendar//gui/e-date-time-list.c 10 Jul 2003 08:50:19 -0000
@@ -291,6 +291,12 @@
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 @@
{
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]