aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/text/e-completion-match.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-06-09 02:31:27 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-06-09 02:31:27 +0800
commit04aed95972de36157dc05b849b7433448458d0bc (patch)
treec5577123ad67d78b328320c85d449a959c4c3266 /widgets/text/e-completion-match.c
parent216d52cd439642b64f0ea789ed68591a7a278c5a (diff)
downloadgsoc2013-evolution-04aed95972de36157dc05b849b7433448458d0bc.tar.gz
gsoc2013-evolution-04aed95972de36157dc05b849b7433448458d0bc.tar.zst
gsoc2013-evolution-04aed95972de36157dc05b849b7433448458d0bc.zip
Turned off alternating row colors in our ETable specification.
2001-06-08 Jon Trowbridge <trow@ximian.com> * 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
Diffstat (limited to 'widgets/text/e-completion-match.c')
-rw-r--r--widgets/text/e-completion-match.c21
1 files changed, 10 insertions, 11 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 *