mirror of
https://github.com/lennart-k/rustical.git
synced 2026-01-30 22:28:22 +00:00
addressbook-query: Fix filter matching for empty filters
This commit is contained in:
@@ -82,6 +82,11 @@ pub struct FilterElement {
|
|||||||
impl FilterElement {
|
impl FilterElement {
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn matches(&self, addr_object: &AddressObject) -> bool {
|
pub fn matches(&self, addr_object: &AddressObject) -> bool {
|
||||||
|
if self.prop_filter.is_empty() {
|
||||||
|
// Filter empty
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
let Allof(allof) = self.test;
|
let Allof(allof) = self.test;
|
||||||
let mut results = self
|
let mut results = self
|
||||||
.prop_filter
|
.prop_filter
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ pub struct PropFilterElement {
|
|||||||
impl PropFilterElement {
|
impl PropFilterElement {
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn match_property(&self, property: &Property) -> bool {
|
pub fn match_property(&self, property: &Property) -> bool {
|
||||||
|
if self.param_filter.is_empty() && self.text_match.is_empty() {
|
||||||
|
// Filter empty
|
||||||
|
return true;
|
||||||
|
}
|
||||||
let Allof(allof) = self.test;
|
let Allof(allof) = self.test;
|
||||||
let text_matches = self
|
let text_matches = self
|
||||||
.text_match
|
.text_match
|
||||||
|
|||||||
Reference in New Issue
Block a user