Skip to content

Commit

Permalink
* mu-msg-iter.cc: if we're using threaded search results, get *all* m…
Browse files Browse the repository at this point in the history
…atches,

  calculate threads and then return maxnum matches
  • Loading branch information
djcb committed Dec 23, 2012
1 parent d17dba6 commit c36906a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/mu-msg-iter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class ThreadKeyMaker: public Xapian::KeyMaker {
GHashTable *_threadinfo;
};


struct _MuMsgIter {
public:
_MuMsgIter (Xapian::Enquire &enq, size_t maxnum,
Expand All @@ -65,7 +64,11 @@ struct _MuMsgIter {
threads = (flags & MU_MSG_ITER_FLAG_THREADS);
descending = (flags & MU_MSG_ITER_FLAG_DESCENDING);

_matches = _enq.get_mset (0, maxnum);
/* if we need to calculate threads, initialy get /all/
* matches, calculate threads based on that, and then
* return maxnum messages
*/
_matches = _enq.get_mset (0, threads ? G_MAXINT: maxnum);

/* when threading, we calculate the threads for the
* set of matches, then requery/sort based on the
Expand Down Expand Up @@ -137,7 +140,8 @@ struct _MuMsgIter {
MuMsgIterFlags _flags;

struct ltstr {
bool operator () (const std::string &s1, const std::string &s2) const {
bool operator () (const std::string &s1,
const std::string &s2) const {
return g_strcmp0 (s1.c_str(), s2.c_str()) < 0;
}
};
Expand Down

0 comments on commit c36906a

Please sign in to comment.