From c43dfb815a4951b8248f4f0e98babe4f80204f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 3 Apr 2015 13:14:53 +0200 Subject: Imported Upstream version 0.22.0 --- src/searches/SearchBoolean.vala | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/searches/SearchBoolean.vala') diff --git a/src/searches/SearchBoolean.vala b/src/searches/SearchBoolean.vala index 431e398..8031814 100644 --- a/src/searches/SearchBoolean.vala +++ b/src/searches/SearchBoolean.vala @@ -1,4 +1,4 @@ -/* Copyright 2011-2014 Yorba Foundation +/* Copyright 2011-2015 Yorba Foundation * * This software is licensed under the GNU LGPL (version 2.1 or later). * See the COPYING file in this distribution. @@ -206,7 +206,8 @@ public class SearchConditionText : SearchCondition { STARTS_WITH, ENDS_WITH, DOES_NOT_CONTAIN, - IS_NOT_SET; + IS_NOT_SET, + IS_SET; public string to_string() { switch (this) { @@ -228,6 +229,9 @@ public class SearchConditionText : SearchCondition { case Context.IS_NOT_SET: return "IS_NOT_SET"; + case Context.IS_SET: + return "IS_SET"; + default: error("unrecognized text search context enumeration value"); } @@ -252,6 +256,9 @@ public class SearchConditionText : SearchCondition { else if (str == "IS_NOT_SET") return Context.IS_NOT_SET; + else if (str == "IS_SET") + return Context.IS_SET; + else error("unrecognized text search context name: %s", str); } @@ -287,6 +294,9 @@ public class SearchConditionText : SearchCondition { case Context.IS_NOT_SET: return (is_string_empty(haystack)); + + case Context.IS_SET: + return (!is_string_empty(haystack)); } return false; @@ -298,10 +308,9 @@ public class SearchConditionText : SearchCondition { // title if (SearchType.ANY_TEXT == search_type || SearchType.TITLE == search_type) { - string title = source.get_title(); - if(title != null){ - ret |= string_match(text, String.remove_diacritics(title.down())); - } + string? title = (null != source.get_title()) ? + String.remove_diacritics(source.get_title().down()) : null; + ret |= string_match(text, title); } // tags -- cgit v1.2.3