lib: improve threaded sorting

Improve threaded sorting:
- rework the recursive algo (which should a crash noted earlier)
- sort by thread key (as in 1.5.7)

Fixes: #1923
Fixes: #1922
Fixes: #1911
Fixes: #1916
This commit is contained in:
Dirk-Jan C. Binnema
2021-02-10 12:35:19 +02:00
parent 58e4046cbd
commit 6ff9829ce1
5 changed files with 343 additions and 316 deletions

View File

@ -28,16 +28,13 @@ namespace Mu {
* thread-paths for each message, so we can let Xapian order them in the correct
* order.
*
* Note - threads are can be order by an arbitrary field for the top level, but
* the messages below the top level are always sorted in chronologically
* ascending orde
* Note - threads are sorted chronologically, and the messages below the top
* level are always sorted in ascending orde
*
* @param qres query results
* @param sort_field the field to sort the top-level by
* @param descending whether to sort the top-level in descending order
*/
void calculate_threads (QueryResults& qres, MuMsgFieldId sort_field,
bool descending);
void calculate_threads (QueryResults& qres, bool descending);
} // namespace Mu