mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Filter
- Modified algorithm for ::pendingOnly.
This commit is contained in:
parent
e4a237fcd3
commit
fab9fe2a7d
1 changed files with 6 additions and 4 deletions
|
@ -214,9 +214,11 @@ bool Filter::pendingOnly ()
|
||||||
Tree* tree = context.parser.tree ();
|
Tree* tree = context.parser.tree ();
|
||||||
|
|
||||||
// To skip loading completed.data, there should be:
|
// To skip loading completed.data, there should be:
|
||||||
// - 'status:pending'
|
// - 'status' in filter
|
||||||
// - no 'or' operators
|
// - no 'completed'
|
||||||
// - no 'xor' operators
|
// - no 'deleted'
|
||||||
|
// - no 'xor'
|
||||||
|
// - no 'or'
|
||||||
int countStatus = 0;
|
int countStatus = 0;
|
||||||
int countPending = 0;
|
int countPending = 0;
|
||||||
int countId = 0;
|
int countId = 0;
|
||||||
|
@ -244,7 +246,7 @@ bool Filter::pendingOnly ()
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Only one 'status == pending' is allowed.
|
// Only one 'status == pending' is allowed.
|
||||||
if (countStatus == 1 && countPending != 1)
|
if (countStatus != 1 || countPending != 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue