]> granicus.if.org Git - mutt/commitdiff
Sorting fix from Gero Treuner.
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 22 Mar 2000 08:24:44 +0000 (08:24 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 22 Mar 2000 08:24:44 +0000 (08:24 +0000)
init.h
mutt.h
sort.c

diff --git a/init.h b/init.h
index acb3697ed783e218a00fa0578fd798148c413380..d1880c43a6887ff4f43f0e72b5ded0416a71b7db 100644 (file)
--- a/init.h
+++ b/init.h
@@ -1836,7 +1836,9 @@ struct option_t MuttVars[] = {
   ** the rest of sort_aux as an ordering.  For instance, set sort_aux=last-
   ** date-received would mean that if a new message is received in a
   ** thread, that thread becomes the last one displayed (or the first, if
-  ** you have set sort=reverse-threads.)
+  ** you have set sort=reverse-threads.) Note: For reversed ``$$sort''
+  ** order $$sort_aux is reversed again (which is not the right thing to do,
+  ** but kept to not break any existing configuration setting).
   */
   { "sort_browser",    DT_SORT|DT_SORT_BROWSER, R_NONE, UL &BrowserSort, SORT_SUBJECT },
   /*
diff --git a/mutt.h b/mutt.h
index 48212dabf095e559cb15f0194057b7d583ac5280..1edab7553b90aedf4613e9fd5cff3db77764403c 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -665,7 +665,6 @@ typedef struct
   unsigned int dontwrite : 1;   /* dont write the mailbox on close */
   unsigned int append : 1;     /* mailbox is opened in append mode */
   unsigned int quiet : 1;      /* inhibit status messages? */
-  unsigned int revsort : 1;    /* mailbox sorted in reverse? */
   unsigned int collapsed : 1;   /* are all threads collapsed? */
   unsigned int closing : 1;    /* mailbox is being closed */
 } CONTEXT;
diff --git a/sort.c b/sort.c
index 16141df40bccb1488078ebf60a61b18995f0b928..7fd4633d976f1637d7b763d3994bece5fa6ffa01 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -218,7 +218,10 @@ void mutt_sort_headers (CONTEXT *ctx, int init)
        subthreads need to be resorted */
     if (option (OPTSORTSUBTHREADS))
     {
+      i = Sort;
+      Sort = SortAux;
       ctx->tree = mutt_sort_subthreads (ctx->tree, mutt_get_sort_func (SortAux));
+      Sort = i;
       unset_option (OPTSORTSUBTHREADS);
     }
     mutt_sort_threads (ctx, init);
@@ -233,11 +236,6 @@ void mutt_sort_headers (CONTEXT *ctx, int init)
   else 
     qsort ((void *) ctx->hdrs, ctx->msgcount, sizeof (HEADER *), sortfunc);
 
-  /* the threading function find_reference() needs to know how the mailbox
-   * is currently sorted in memory in order to speed things up a bit
-   */
-  ctx->revsort = (Sort & SORT_REVERSE) ? 1 : 0;
-
   /* adjust the virtual message numbers */
   ctx->vcount = 0;
   for (i = 0; i < ctx->msgcount; i++)