From 04aed95972de36157dc05b849b7433448458d0bc Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Fri, 8 Jun 2001 18:31:27 +0000 Subject: Turned off alternating row colors in our ETable specification. 2001-06-08 Jon Trowbridge * gal/e-text/e-completion-view.c: Turned off alternating row colors in our ETable specification. * gal/e-text/e-completion-match.c (e_completion_match_compare_alpha): Fix the sort routine to properly use the major & minor keys for sorting grouped elements with the same match text. I had this all wrong. svn path=/trunk/; revision=10159 --- widgets/text/e-completion-match.c | 21 ++++++++++----------- widgets/text/e-completion-view.c | 2 +- widgets/text/e-completion.c | 1 - 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/widgets/text/e-completion-match.c b/widgets/text/e-completion-match.c index e00d5c8bdb..a3e69cb2ed 100644 --- a/widgets/text/e-completion-match.c +++ b/widgets/text/e-completion-match.c @@ -141,11 +141,10 @@ e_completion_match_compare (const ECompletionMatch *a, const ECompletionMatch *b return 0; } -/* Copied from the above, with one addition. */ gint e_completion_match_compare_alpha (const ECompletionMatch *a, const ECompletionMatch *b) { - gint rv; + gint rv, rv2; /* Deal with NULL arguments. */ if (!(a || b)) { @@ -158,17 +157,17 @@ e_completion_match_compare_alpha (const ECompletionMatch *a, const ECompletionMa if ( (rv = (b->score > a->score) - (a->score > b->score)) ) return rv; - /* Consider the menu text in the sort. */ - if ( (rv = strcmp (a->menu_text, b->menu_text)) ) - return rv; - - if ( (rv = (b->sort_major < a->sort_major) - (a->sort_major < b->sort_major)) ) - return rv; + /* When the match text is the same, we use the major and minor fields */ + rv2 = strcmp (a->match_text, b->match_text); + if (!rv2) { + if ( (rv = (b->sort_major < a->sort_major) - (a->sort_major < b->sort_major)) ) + return rv; - if ( (rv = (b->sort_minor < a->sort_minor) - (a->sort_minor < b->sort_minor)) ) - return rv; + if ( (rv = (b->sort_minor < a->sort_minor) - (a->sort_minor < b->sort_minor)) ) + return rv; + } - return 0; + return strcmp (a->menu_text, b->menu_text); } ECompletionMatch * diff --git a/widgets/text/e-completion-view.c b/widgets/text/e-completion-view.c index e62209efe6..53bb24bc3d 100644 --- a/widgets/text/e-completion-view.c +++ b/widgets/text/e-completion-view.c @@ -584,7 +584,7 @@ end_completion_cb (ECompletion *completion, gpointer user_data) /*** Table Callbacks ***/ static char *simple_spec = -" " +"" " " diff --git a/widgets/text/e-completion.c b/widgets/text/e-completion.c index f15ce3027e..0ede90a088 100644 --- a/widgets/text/e-completion.c +++ b/widgets/text/e-completion.c @@ -320,7 +320,6 @@ e_completion_sort (ECompletion *complete) sort_list = g_list_sort (sort_list, (GCompareFunc) e_completion_match_compare_alpha); - diff = FALSE; count = 0; i = complete->priv->matches; -- cgit v1.2.3