FilterConfig: return bool
This commit is contained in:
		| @@ -86,15 +86,12 @@ filter_chain_append_new(Filter &chain, const char *template_name, Error &error) | ||||
| 	return true; | ||||
| } | ||||
|  | ||||
| unsigned int | ||||
| bool | ||||
| filter_chain_parse(Filter &chain, const char *spec, Error &error) | ||||
| { | ||||
|  | ||||
| 	// Split on comma | ||||
| 	gchar** tokens = g_strsplit_set(spec, ",", 255); | ||||
|  | ||||
| 	unsigned added_filters = 0; | ||||
|  | ||||
| 	// Add each name to the filter chain by instantiating an actual filter | ||||
| 	char **template_names = tokens; | ||||
| 	while (*template_names != NULL) { | ||||
| @@ -102,14 +99,12 @@ filter_chain_parse(Filter &chain, const char *spec, Error &error) | ||||
| 		g_strstrip(*template_names); | ||||
|  | ||||
| 		if (!filter_chain_append_new(chain, *template_names, error)) | ||||
| 			break; | ||||
|  | ||||
| 		++added_filters; | ||||
| 			return false; | ||||
|  | ||||
| 		++template_names; | ||||
| 	} | ||||
|  | ||||
| 	g_strfreev(tokens); | ||||
|  | ||||
| 	return added_filters; | ||||
| 	return true; | ||||
| } | ||||
|   | ||||
| @@ -35,9 +35,9 @@ class Error; | ||||
|  * @param chain the chain to append filters on | ||||
|  * @param spec the filter chain specification | ||||
|  * @param error_r space to return an error description | ||||
|  * @return the number of filters which were successfully added | ||||
|  * @return true on success | ||||
|  */ | ||||
| unsigned int | ||||
| bool | ||||
| filter_chain_parse(Filter &chain, const char *spec, Error &error); | ||||
|  | ||||
| #endif | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann