44 lines
1.7 KiB
Diff
44 lines
1.7 KiB
Diff
# UNDF: UNDF-2026-000001090
|
|
# UNDF:
|
|
--- a/src/calendar/gui/e-date-time-list.c
|
|
+++ b/src/calendar/gui/e-date-time-list.c
|
|
@@ -56,6 +56,7 @@ struct _EDateTimeListPrivate {
|
|
GList *list;
|
|
gboolean use_24_hour_format;
|
|
gint stamp;
|
|
+ GHashTable *date_set; /* ISO-date string keys for O(1) dedup */
|
|
};
|
|
|
|
/* EDateTimeList is a GtkTreeModel implementation that stores ICalTime
|
|
@@ -580,8 +580,21 @@ e_date_time_list_append (EDateTimeList *date_time_list,
|
|
g_return_if_fail (i_cal_time_is_valid_time ((ICalTime *) itt));
|
|
|
|
- if (g_list_find_custom (date_time_list->priv->list, itt, (GCompareFunc) compare_datetime) == NULL) {
|
|
+ if (date_time_list->priv->date_set == NULL)
|
|
+ date_time_list->priv->date_set = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
|
|
+
|
|
+ /* Build a canonical key: YYYYMMDD or YYYYMMDDTHHMMSS[Z] */
|
|
+ gchar *key = i_cal_time_as_ical_string ((ICalTime *) itt);
|
|
+ if (key == NULL)
|
|
+ return;
|
|
+
|
|
+ if (!g_hash_table_contains (date_time_list->priv->date_set, key)) {
|
|
+ g_hash_table_add (date_time_list->priv->date_set, key); /* takes ownership */
|
|
date_time_list->priv->list = g_list_append (date_time_list->priv->list, i_cal_time_clone (itt));
|
|
row_added (date_time_list, g_list_length (date_time_list->priv->list) - 1);
|
|
+ } else {
|
|
+ g_free (key);
|
|
}
|
|
|
|
if (iter) {
|
|
@@ -598,6 +611,10 @@ e_date_time_list_clear (EDateTimeList *date_time_list)
|
|
g_return_if_fail (E_IS_DATE_TIME_LIST (date_time_list));
|
|
|
|
+ if (date_time_list->priv->date_set) {
|
|
+ g_hash_table_destroy (date_time_list->priv->date_set);
|
|
+ date_time_list->priv->date_set = NULL;
|
|
+ }
|
|
+
|
|
g_list_free_full (date_time_list->priv->list, g_object_unref);
|
|
date_time_list->priv->list = NULL;
|
|
date_time_list->priv->stamp++;
|