- Add patch for Gnome.org bug #356177 (deprecate EMutex).

- Add patch for Gnome.org bug #363695 (deprecate EStrv/EPoolv).
- Disable patch for RH bug #202751 (unwanted side-effects).
This commit is contained in:
Matthew Barnes 2006-10-27 22:27:55 +00:00
parent 4501bb6f68
commit ad2b69c948
3 changed files with 2325 additions and 10 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,299 @@
--- evolution-2.9.1/mail/message-list.c.ememory 2006-10-25 11:11:34.000000000 -0400
+++ evolution-2.9.1/mail/message-list.c 2006-10-25 11:15:12.000000000 -0400
@@ -412,70 +412,28 @@
return info;
}
-static const char *
-get_normalised_string (MessageList *message_list, CamelMessageInfo *info, int col)
+static const gchar *
+get_normalised_string (MessageList *message_list, const gchar *string)
{
- const char *string, *str;
- char *normalised;
- EPoolv *poolv;
- int index;
-
- switch (col) {
- case COL_SUBJECT_NORM:
- string = camel_message_info_subject (info);
- index = NORMALISED_SUBJECT;
- break;
- case COL_FROM_NORM:
- string = camel_message_info_from (info);
- index = NORMALISED_FROM;
- break;
- case COL_TO_NORM:
- string = camel_message_info_to (info);
- index = NORMALISED_TO;
- break;
- default:
- string = NULL;
- index = NORMALISED_LAST;
- g_assert_not_reached ();
- }
-
- /* slight optimisation */
- if (string == NULL || string[0] == '\0')
+ GHashTable *hash_table = message_list->normalised_hash;
+ GStringChunk *string_chunk = message_list->string_chunk;
+ gchar *collation_key, *temp;
+
+ if (string == NULL || *string == '\0')
return "";
-
- poolv = g_hash_table_lookup (message_list->normalised_hash, camel_message_info_uid (info));
- if (poolv == NULL) {
- poolv = e_poolv_new (NORMALISED_LAST);
- g_hash_table_insert (message_list->normalised_hash, (char *) camel_message_info_uid (info), poolv);
- } else {
- str = e_poolv_get (poolv, index);
- if (*str)
- return str;
- }
-
- if (col == COL_SUBJECT_NORM) {
- const unsigned char *subject;
-
- subject = (const unsigned char *) string;
- while (!g_ascii_strncasecmp (subject, "Re:", 3)) {
- subject += 3;
-
- /* jump over any spaces */
- while (*subject && isspace ((int) *subject))
- subject++;
- }
-
- /* jump over any spaces */
- while (*subject && isspace ((int) *subject))
- subject++;
-
- string = (const char *) subject;
- }
-
- normalised = g_utf8_collate_key (string, -1);
- e_poolv_set (poolv, index, normalised, TRUE);
-
- return e_poolv_get (poolv, index);
+
+ collation_key = g_hash_table_lookup (hash_table, string);
+ if (collation_key != NULL)
+ return collation_key;
+
+ temp = g_utf8_collate_key (string, -1);
+ collation_key = g_string_chunk_insert_const (string_chunk, temp);
+ g_free (temp);
+
+ temp = g_string_chunk_insert_const (string_chunk, string);
+ g_hash_table_insert (hash_table, temp, collation_key);
+
+ return collation_key;
}
static void
@@ -1283,12 +1241,23 @@
str = camel_message_info_from (msg_info);
return (void *)(str ? str : "");
case COL_FROM_NORM:
- return (void *) get_normalised_string (message_list, msg_info, col);
+ str = camel_message_info_from (msg_info);
+ return (void *) get_normalised_string (message_list, str);
case COL_SUBJECT:
str = camel_message_info_subject (msg_info);
return (void *)(str ? str : "");
case COL_SUBJECT_NORM:
- return (void *) get_normalised_string (message_list, msg_info, col);
+ str = camel_message_info_subject (msg_info);
+ while (str != NULL && *str != '\0') {
+ /* skip over spaces and reply prefixes */
+ if (g_ascii_strncasecmp (str, "Re:", 3) == 0)
+ str += 3;
+ else if (g_ascii_isspace (*str))
+ str++;
+ else
+ break;
+ }
+ return (void *) get_normalised_string (message_list, str);
case COL_SENT: {
ETreePath child;
@@ -1312,7 +1281,8 @@
str = camel_message_info_to (msg_info);
return (void *)(str ? str : "");
case COL_TO_NORM:
- return (void *) get_normalised_string (message_list, msg_info, col);
+ str = camel_message_info_to (str);
+ return (void *) get_normalised_string (message_list, str);
case COL_SIZE:
return GINT_TO_POINTER (camel_message_info_size(msg_info));
case COL_DELETED:
@@ -2023,9 +1993,10 @@
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (message_list), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
message_list->normalised_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ message_list->string_chunk = g_string_chunk_new (1024);
message_list->hidden = NULL;
- message_list->hidden_pool = NULL;
+ message_list->hidden_string_chunk = NULL;
message_list->hide_before = ML_HIDE_NONE_START;
message_list->hide_after = ML_HIDE_NONE_END;
@@ -2054,14 +2025,6 @@
g_signal_connect (((GtkScrolledWindow *) message_list)->vscrollbar, "value-changed", G_CALLBACK (ml_scrolled), message_list);
}
-static gboolean
-normalised_free (gpointer key, gpointer value, gpointer user_data)
-{
- e_poolv_destroy (value);
-
- return TRUE;
-}
-
static void
message_list_destroy(GtkObject *object)
{
@@ -2127,17 +2090,17 @@
MessageList *message_list = MESSAGE_LIST (object);
struct _MessageListPrivate *p = message_list->priv;
- g_hash_table_foreach (message_list->normalised_hash, (GHFunc) normalised_free, NULL);
g_hash_table_destroy (message_list->normalised_hash);
+ g_string_chunk_free (message_list->string_chunk);
if (message_list->thread_tree)
camel_folder_thread_messages_unref(message_list->thread_tree);
if (message_list->hidden) {
g_hash_table_destroy(message_list->hidden);
- e_mempool_destroy(message_list->hidden_pool);
+ g_string_chunk_free(message_list->hidden_string_chunk);
message_list->hidden = NULL;
- message_list->hidden_pool = NULL;
+ message_list->hidden_string_chunk = NULL;
}
g_free(message_list->search);
@@ -2940,17 +2903,6 @@
d(printf("changed = %d added = %d removed = %d\n",
changes->uid_changed->len, changes->uid_added->len, changes->uid_removed->len));
- for (i = 0; i < changes->uid_removed->len; i++) {
- /* uncache the normalised strings for these uids */
- EPoolv *poolv;
-
- poolv = g_hash_table_lookup (ml->normalised_hash, changes->uid_removed->pdata[i]);
- if (poolv != NULL) {
- g_hash_table_remove (ml->normalised_hash, changes->uid_removed->pdata[i]);
- e_poolv_destroy (poolv);
- }
- }
-
/* check if the hidden state has changed, if so modify accordingly, then regenerate */
if (ml->hidejunk || ml->hidedeleted)
mail_folder_hide_by_flag (folder, ml, &changes, (ml->hidejunk ? CAMEL_MESSAGE_JUNK : 0) | (ml->hidedeleted ? CAMEL_MESSAGE_DELETED : 0));
@@ -3028,7 +2980,11 @@
}
/* reset the normalised sort performance hack */
- g_hash_table_foreach_remove (message_list->normalised_hash, normalised_free, NULL);
+ /* XXX GLib 2.12 added g_hash_table_remove_all() */
+ g_hash_table_destroy (message_list->normalised_hash);
+ message_list->normalised_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ g_string_chunk_free (message_list->string_chunk);
+ message_list->string_chunk = g_string_chunk_new (1024);
mail_regen_cancel(message_list);
@@ -3479,14 +3435,14 @@
MESSAGE_LIST_LOCK (ml, hide_lock);
if (ml->hidden == NULL) {
ml->hidden = g_hash_table_new (g_str_hash, g_str_equal);
- ml->hidden_pool = e_mempool_new (512, 256, E_MEMPOOL_ALIGN_BYTE);
+ ml->hidden_string_chunk = g_string_chunk_new (512);
}
- uid = e_mempool_strdup (ml->hidden_pool, uids->pdata[i]);
+ uid = g_string_chunk_insert (ml->hidden_string_chunk, uids->pdata[i]);
g_hash_table_insert (ml->hidden, uid, uid);
for ( ; i < uids->len; i++) {
if (g_hash_table_lookup (ml->uid_nodemap, uids->pdata[i])) {
- uid = e_mempool_strdup (ml->hidden_pool, uids->pdata[i]);
+ uid = g_string_chunk_insert (ml->hidden_string_chunk, uids->pdata[i]);
g_hash_table_insert (ml->hidden, uid, uid);
}
}
@@ -3507,9 +3463,9 @@
MESSAGE_LIST_LOCK (ml, hide_lock);
if (ml->hidden) {
g_hash_table_destroy (ml->hidden);
- e_mempool_destroy (ml->hidden_pool);
+ g_string_chunk_free (ml->hidden_string_chunk);
ml->hidden = NULL;
- ml->hidden_pool = NULL;
+ ml->hidden_string_chunk = NULL;
}
ml->hide_before = ML_HIDE_NONE_START;
ml->hide_after = ML_HIDE_NONE_END;
@@ -3545,9 +3501,9 @@
MESSAGE_LIST_LOCK(ml, hide_lock);
if (ml->hidden) {
g_hash_table_destroy (ml->hidden);
- e_mempool_destroy (ml->hidden_pool);
+ g_string_chunk_free (ml->hidden_string_chunk);
ml->hidden = NULL;
- ml->hidden_pool = NULL;
+ ml->hidden_string_chunk = NULL;
}
ml->hide_before = ML_HIDE_NONE_START;
ml->hide_after = ML_HIDE_NONE_END;
@@ -3558,7 +3514,7 @@
camel_file_util_decode_fixed_int32 (in, &version);
if (version == HIDE_STATE_VERSION) {
ml->hidden = g_hash_table_new(g_str_hash, g_str_equal);
- ml->hidden_pool = e_mempool_new(512, 256, E_MEMPOOL_ALIGN_BYTE);
+ ml->hidden_string_chunk = g_string_chunk_new(512);
camel_file_util_decode_fixed_int32 (in, &lower);
ml->hide_before = lower;
camel_file_util_decode_fixed_int32 (in, &upper);
@@ -3567,7 +3523,7 @@
char *olduid, *uid;
if (camel_file_util_decode_string (in, &olduid) != -1) {
- uid = e_mempool_strdup(ml->hidden_pool, olduid);
+ uid = g_string_chunk_insert(ml->hidden_string_chunk, olduid);
g_free (olduid);
g_hash_table_insert(ml->hidden, uid, uid);
}
@@ -3717,12 +3673,12 @@
if (m->ml->hidden == NULL) {
m->ml->hidden = g_hash_table_new (g_str_hash, g_str_equal);
- m->ml->hidden_pool = e_mempool_new (512, 256, E_MEMPOOL_ALIGN_BYTE);
+ m->ml->hidden_string_chunk = g_string_chunk_new (512);
}
for (i = 0; i < uidnew->len; i++) {
if (g_hash_table_lookup (m->ml->hidden, uidnew->pdata[i]) == 0) {
- char *uid = e_mempool_strdup (m->ml->hidden_pool, uidnew->pdata[i]);
+ char *uid = g_string_chunk_insert (m->ml->hidden_string_chunk, uidnew->pdata[i]);
g_hash_table_insert (m->ml->hidden, uid, uid);
}
}
--- evolution-2.9.1/mail/message-list.h.ememory 2006-09-28 04:56:51.000000000 -0400
+++ evolution-2.9.1/mail/message-list.h 2006-10-25 11:15:12.000000000 -0400
@@ -102,11 +102,12 @@
GHashTable *uid_nodemap; /* uid (from info) -> tree node mapping */
GHashTable *normalised_hash;
+ GStringChunk *string_chunk;
/* UID's to hide. Keys in the mempool */
/* IMPORTANT: You MUST have obtained the hide lock, to operate on this data */
GHashTable *hidden;
- struct _EMemPool *hidden_pool;
+ GStringChunk *hidden_string_chunk;
int hide_unhidden; /* total length, before hiding */
int hide_before, hide_after; /* hide ranges of messages */

View File

@ -35,7 +35,7 @@
%define use_mozilla_nss 1
# Use stricter build settings than required by upstream.
%define strict_build_settings 1
%define strict_build_settings 0
%define evo_plugin_dir %{_libdir}/evolution/%{evo_major}/plugins
@ -43,7 +43,7 @@
Name: evolution
Version: 2.9.1
Release: 1%{?dist}
Release: 2%{?dist}
License: GPL
Group: Applications/Productivity
Summary: GNOME's next-generation groupware suite
@ -109,14 +109,17 @@ Patch26: evolution-2.7.92-fix-prgname.patch
# RH bug #161885 / Gnome.org bug #309166
Patch27: evolution-2.8.0-indic-cursor-movement.patch
# Gnome.org bug #356177
Patch28: evolution-2.8.0-kill-emutex.patch
# Gnome.org bug #357216
Patch28: evolution-2.8.0-deprecated-gdk-font.patch
Patch29: evolution-2.8.0-deprecated-gdk-font.patch
# Gnome.org bug #357970
Patch29: evolution-2.8.0-more-deprecated.patch
Patch30: evolution-2.8.0-more-deprecated.patch
# RH bug #202751 / Gnome.org bug #355766
Patch30: evolution-2.8.0-fix-indic-printing.patch
#Patch31: evolution-2.8.0-fix-indic-printing.patch
# Gnome.org bug #360240
Patch32: evolution-2.8.1-warn-unused-variable.patch
@ -128,7 +131,10 @@ Patch33: evolution-2.8.1-warn-incompatible-pointer-type.patch
Patch34: evolution-2.8.1-about-dialog.patch
# Gnome.org bug #362638
Patch35: evolution-2.8.1-ethread.patch
Patch35: evolution-2.8.1-kill-ethread.patch
# Gnome.org bug #363695
Patch36: evolution-2.9.1-kill-ememory.patch
## Dependencies ###
@ -259,13 +265,15 @@ Development files needed for building things which link against evolution.
%patch25 -p1 -b .deleting-preedit-buffer
%patch26 -p1 -b .fix-prgname
%patch27 -p1 -b .indic-cursor-movement
%patch28 -p1 -b .deprecated-gdk-font
%patch29 -p1 -b .more-deprecated
%patch30 -p1 -b .fix-indic-printing
%patch28 -p1 -b .kill-emutex
%patch29 -p1 -b .deprecated-gdk-font
%patch30 -p1 -b .more-deprecated
#%patch31 -p1 -b .fix-indic-printing
%patch32 -p1 -b .warn-unused-variable
%patch33 -p1 -b .warn-incompatible-pointer-type
%patch34 -p1 -b .about-dialog
%patch35 -p1 -b .ethread
%patch35 -p1 -b .kill-ethread
%patch36 -p1 -b .kill-ememory
mkdir -p krb5-fakeprefix/include
mkdir -p krb5-fakeprefix/lib
@ -665,6 +673,11 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/evolution/%{evo_major}/libmenus.so
%changelog
* Fri Oct 20 2006 Matthew Barnes <mbarnes@redhat.com> - 2.9.1-2.fc7
- Add patch for Gnome.org bug #356177 (deprecate EMutex).
- Add patch for Gnome.org bug #363695 (deprecate EStrv/EPoolv).
- Disable patch for RH bug #202751 (unwanted side-effects).
* Mon Oct 16 2006 Matthew Barnes <mbarnes@redhat.com> - 2.9.1-1.fc7
- Update to 2.9.1
- Bump eds_version to 1.9.1, evo_major to 2.10.