mirror of https://github.com/djcb/mu.git
* mu-msg-iter.{cc,h}: make flag names a bit clearer
This commit is contained in:
parent
4ccfe56e41
commit
8fdd82d549
|
@ -60,10 +60,10 @@ public:
|
||||||
MuMsgFieldId sortfield, MuMsgIterFlags flags):
|
MuMsgFieldId sortfield, MuMsgIterFlags flags):
|
||||||
_enq(enq), _thread_hash (0), _msg(0), _flags(flags) {
|
_enq(enq), _thread_hash (0), _msg(0), _flags(flags) {
|
||||||
|
|
||||||
bool threads, revert;
|
bool threads, descending;
|
||||||
|
|
||||||
threads = (flags & MU_MSG_ITER_FLAG_THREADS);
|
threads = (flags & MU_MSG_ITER_FLAG_THREADS);
|
||||||
revert = (flags & MU_MSG_ITER_FLAG_REVERT);
|
descending = (flags & MU_MSG_ITER_FLAG_DESCENDING);
|
||||||
|
|
||||||
|
|
||||||
_matches = _enq.get_mset (0, maxnum);
|
_matches = _enq.get_mset (0, maxnum);
|
||||||
|
@ -76,7 +76,7 @@ public:
|
||||||
_matches.fetch();
|
_matches.fetch();
|
||||||
_thread_hash = mu_threader_calculate
|
_thread_hash = mu_threader_calculate
|
||||||
(this, _matches.size(), sortfield,
|
(this, _matches.size(), sortfield,
|
||||||
revert ? TRUE: FALSE);
|
descending ? TRUE: FALSE);
|
||||||
|
|
||||||
ThreadKeyMaker keymaker(_thread_hash);
|
ThreadKeyMaker keymaker(_thread_hash);
|
||||||
|
|
||||||
|
@ -232,6 +232,7 @@ has_duplicate_msgid (MuMsgIter *iter)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
iter->remember_msgid (msgid);
|
iter->remember_msgid (msgid);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,11 +254,13 @@ mu_msg_iter_next (MuMsgIter *iter)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* filter out non-existing messages? */
|
/* filter out non-existing messages? */
|
||||||
else if ((iter->flags() & MU_MSG_ITER_FLAG_MSG_READABLE) &&
|
else if ((iter->flags() &
|
||||||
is_msg_file_readable (iter))
|
MU_MSG_ITER_FLAG_SKIP_UNREADABLE) &&
|
||||||
|
!is_msg_file_readable (iter))
|
||||||
return mu_msg_iter_next (iter); /*skip!*/
|
return mu_msg_iter_next (iter); /*skip!*/
|
||||||
/* filter out msgid duplicates? */
|
/* filter out msgid duplicates? */
|
||||||
else if ((iter->flags() & MU_MSG_ITER_FLAG_NO_MSGID_DUPS) &&
|
else if ((iter->flags() &
|
||||||
|
MU_MSG_ITER_FLAG_SKIP_MSGID_DUPS) &&
|
||||||
has_duplicate_msgid (iter))
|
has_duplicate_msgid (iter))
|
||||||
return mu_msg_iter_next (iter); /*skip!*/
|
return mu_msg_iter_next (iter); /*skip!*/
|
||||||
else
|
else
|
||||||
|
|
|
@ -38,17 +38,17 @@ typedef struct _MuMsgIter MuMsgIter;
|
||||||
|
|
||||||
|
|
||||||
enum _MuMsgIterFlags {
|
enum _MuMsgIterFlags {
|
||||||
MU_MSG_ITER_FLAG_NONE = 0,
|
MU_MSG_ITER_FLAG_NONE = 0,
|
||||||
/*calculate the threads? */
|
/*calculate the threads? */
|
||||||
MU_MSG_ITER_FLAG_THREADS = 1 << 0,
|
MU_MSG_ITER_FLAG_THREADS = 1 << 0,
|
||||||
/* revert the sort order (only for threads) */
|
/* sort Z->A (only for threads) */
|
||||||
MU_MSG_ITER_FLAG_REVERT = 1 << 1,
|
MU_MSG_ITER_FLAG_DESCENDING = 1 << 1,
|
||||||
/* ignore results for which there is no existing
|
/* ignore results for which there is no existing
|
||||||
* readable message-file? */
|
* readable message-file? */
|
||||||
MU_MSG_ITER_FLAG_MSG_READABLE = 1 << 2,
|
MU_MSG_ITER_FLAG_SKIP_UNREADABLE = 1 << 2,
|
||||||
/* ignore result which have a message id already seen in these
|
/* ignore result which have a message id already seen in these
|
||||||
* results? */
|
* results? */
|
||||||
MU_MSG_ITER_FLAG_NO_MSGID_DUPS = 1 << 3
|
MU_MSG_ITER_FLAG_SKIP_MSGID_DUPS = 1 << 3
|
||||||
};
|
};
|
||||||
typedef unsigned MuMsgIterFlags;
|
typedef unsigned MuMsgIterFlags;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue