# HG changeset patch # User Matti Hamalainen # Date 1189608944 -10800 # Node ID 2f5ef443b231995e36a8528c9d57293d7f25eac9 # Parent 46a0eb1426f69b4c46d942940f39a7658f53a7f3 tuple_formatter_expression_exists() now checks for empty fields, becoming the exact opposite of tuple_formatter_expression_empty(). diff -r 46a0eb1426f6 -r 2f5ef443b231 src/audacious/tuple_formatter.c --- a/src/audacious/tuple_formatter.c Wed Sep 12 05:32:56 2007 -0500 +++ b/src/audacious/tuple_formatter.c Wed Sep 12 17:55:44 2007 +0300 @@ -379,13 +379,6 @@ tuple_formatter_func_list = g_list_append(tuple_formatter_func_list, expr); } -/* builtin-keyword: ${?arg}, returns TRUE if exists. */ -static gboolean -tuple_formatter_expression_exists(Tuple *tuple, const gchar *expression) -{ - return (tuple_get_value_type(tuple, -1, expression) != TUPLE_UNKNOWN) ? TRUE : FALSE; -} - /* builtin-keyword: ${==arg1,arg2}, returns TRUE if and match. and can also be raw text, which should be enclosed in "double quotes". */ static gboolean @@ -461,7 +454,7 @@ return tuple_formatter_expression_match(tuple, expression) ^ 1; } -/* builtin-keyword: ${empty?}. returns TRUE if is empty. */ +/* builtin-keyword: ${(empty)?}. returns TRUE if is empty. */ static gboolean tuple_formatter_expression_empty(Tuple *tuple, const gchar *expression) { @@ -488,6 +481,13 @@ return ret; } +/* builtin-keyword: ${?arg}, returns TRUE if exists. */ +static gboolean +tuple_formatter_expression_exists(Tuple *tuple, const gchar *expression) +{ + return !tuple_formatter_expression_empty(tuple, expression); +} + /* builtin function: %{audacious-version} */ static gchar * tuple_formatter_function_version(Tuple *tuple, gchar **args)