From d38d32c404270835f4d69d80b8f0f566cfabf713 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Thu, 9 Jun 2022 00:38:34 +0300 Subject: [PATCH] query-threads/results: cosmetics --- lib/mu-query-results.hh | 11 ++++++----- lib/mu-query-threads.cc | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/mu-query-results.hh b/lib/mu-query-results.hh index c2168329..7b8a72e1 100644 --- a/lib/mu-query-results.hh +++ b/lib/mu-query-results.hh @@ -267,18 +267,19 @@ public: } /** - * Get the date for the document (message) the iterator is pointing at. - * pointing at, or Nothing. + * Get the a sortable date str for the document (message) the iterator + * is pointing at. pointing at, or Nothing. This (encoded) string + * has the same sort-order as the corresponding date. * * @return a filesystem path */ - Option date() const noexcept { + Option date_str() const noexcept { return opt_string(Field::Id::Date); } /** - * Get the file-system path for the document (message) this iterator is - * pointing at. + * Get the subject for the document (message) this iterator is pointing + * at. * * @return the subject */ diff --git a/lib/mu-query-threads.cc b/lib/mu-query-threads.cc index caf56fcc..22a3b7af 100644 --- a/lib/mu-query-threads.cc +++ b/lib/mu-query-threads.cc @@ -186,7 +186,7 @@ determine_id_table(QueryResultsType& qres) // order, still sort the thread levels below that in ascending // order. container.thread_date_key = container.query_match->date_key = - mi.date().value_or(""); + mi.date_str().value_or(""); // initial guess for the thread-date; might be updated // later. @@ -618,7 +618,7 @@ struct MockQueryResult { } Option message_id() const { return message_id_; } Option path() const { return path_; } - Option date() const { return date_; } + Option date_str() const { return date_; } Option subject() const { return subject_; } QueryMatch& query_match() { return query_match_; } const QueryMatch& query_match() const { return query_match_; }