aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/text/e-reflow.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-10-20 19:31:46 +0800
committerMilan Crha <mcrha@redhat.com>2010-10-20 19:34:53 +0800
commit7a07c80767950787601924b2b8091c8a0cb3371a (patch)
treeeaf24f2ab4aca5795ebac2353e7dbde991d962c9 /widgets/text/e-reflow.c
parentb1f84e3c36a3e64caa8eac4b7f88252225cbf405 (diff)
downloadgsoc2013-evolution-7a07c80767950787601924b2b8091c8a0cb3371a.tar.gz
gsoc2013-evolution-7a07c80767950787601924b2b8091c8a0cb3371a.tar.zst
gsoc2013-evolution-7a07c80767950787601924b2b8091c8a0cb3371a.zip
Bug #630504 - Precache collate keys before sorting in EReflowModel
Diffstat (limited to 'widgets/text/e-reflow.c')
-rw-r--r--widgets/text/e-reflow.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c
index d7522d6344..a796d92bba 100644
--- a/widgets/text/e-reflow.c
+++ b/widgets/text/e-reflow.c
@@ -74,11 +74,18 @@ enum {
static guint signals[LAST_SIGNAL] = {0, };
+static GHashTable *
+er_create_cmp_cache (gpointer user_data)
+{
+ EReflow *reflow = user_data;
+ return e_reflow_model_create_cmp_cache (reflow->model);
+}
+
static gint
-er_compare (gint i1, gint i2, gpointer user_data)
+er_compare (gint i1, gint i2, GHashTable *cmp_cache, gpointer user_data)
{
EReflow *reflow = user_data;
- return e_reflow_model_compare (reflow->model, i1, i2);
+ return e_reflow_model_compare (reflow->model, i1, i2, cmp_cache);
}
static gint
@@ -1594,7 +1601,7 @@ e_reflow_init (EReflow *reflow)
reflow->set_scroll_adjustments_id = 0;
reflow->selection = E_SELECTION_MODEL (e_selection_model_simple_new ());
- reflow->sorter = e_sorter_array_new (er_compare, reflow);
+ reflow->sorter = e_sorter_array_new (er_create_cmp_cache, er_compare, reflow);
g_object_set (reflow->selection,
"sorter", reflow->sorter,