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
|
3.4.0
|
||||||
========================
|
========================
|
||||||
* Added support for Stripchat
|
* Added support for Stripchat
|
||||||
|
|
|
@ -814,8 +814,14 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
|
||||||
if (m.getOnlineState(true) != ctbrec.Model.State.ONLINE) {
|
if (m.getOnlineState(true) != ctbrec.Model.State.ONLINE) {
|
||||||
tokensMissing = true;
|
tokensMissing = true;
|
||||||
}
|
}
|
||||||
} else if (!searchText.toLowerCase().contains(token.toLowerCase())) {
|
} else {
|
||||||
tokensMissing = true;
|
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;
|
return !tokensMissing;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue