forked from j62/ctbrec
Add negation (!) to filter bar
Filter terms can now be negated with !
This commit is contained in:
parent
e333722522
commit
76794e588e
|
@ -1,3 +1,7 @@
|
|||
3.4.1
|
||||
========================
|
||||
* Filter terms can now be negated by prepending them with a "!"
|
||||
|
||||
3.4.0
|
||||
========================
|
||||
* Added support for Stripchat
|
||||
|
|
|
@ -814,8 +814,14 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
|
|||
if (m.getOnlineState(true) != ctbrec.Model.State.ONLINE) {
|
||||
tokensMissing = true;
|
||||
}
|
||||
} else if (!searchText.toLowerCase().contains(token.toLowerCase())) {
|
||||
tokensMissing = true;
|
||||
} else {
|
||||
boolean negated = false;
|
||||
if(token.startsWith("!")) {
|
||||
negated = true;
|
||||
token = token.substring(1);
|
||||
}
|
||||
boolean tokenFound = searchText.toLowerCase().contains(token.toLowerCase());
|
||||
tokensMissing = !tokenFound && !negated || tokenFound && negated;
|
||||
}
|
||||
return !tokensMissing;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue