diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-04-03 13:15:00 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-04-03 13:15:00 +0200 |
commit | bc53b714952ceb0afd02b591403cb2bc0cb1aab9 (patch) | |
tree | 8ff57ed1a1265b2c87f37e3c8fa19876faf80990 /src/searches/SearchBoolean.vala | |
parent | d4c476947425c12b1984fedea16f8a8c42a07ba3 (diff) | |
parent | c43dfb815a4951b8248f4f0e98babe4f80204f03 (diff) |
Merge tag 'upstream/0.22.0'
Upstream version 0.22.0
Diffstat (limited to 'src/searches/SearchBoolean.vala')
-rw-r--r-- | src/searches/SearchBoolean.vala | 21 |
1 files changed, 15 insertions, 6 deletions
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 |