From 2b676dc5fcd7b3a472d4c14f228ea4b7969b4e9e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 5 Sep 2013 18:23:15 +0200 Subject: Tag: move configuration code to TagConfig.cxx Allow using the Tag.cxx library without the Config library. --- src/tag/Tag.cxx | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) (limited to 'src/tag/Tag.cxx') diff --git a/src/tag/Tag.cxx b/src/tag/Tag.cxx index c960da537..2b1967006 100644 --- a/src/tag/Tag.cxx +++ b/src/tag/Tag.cxx @@ -21,15 +21,9 @@ #include "Tag.hxx" #include "TagInternal.hxx" #include "TagPool.hxx" -#include "ConfigGlobal.hxx" -#include "ConfigOption.hxx" -#include "Song.hxx" -#include "system/FatalError.hxx" #include #include -#include -#include #include /** @@ -85,52 +79,8 @@ items_size(const Tag &tag) void tag_lib_init(void) { - const char *value; - int quit = 0; - char *temp; - char *s; - char *c; - enum tag_type type; - - /* parse the "metadata_to_use" config parameter below */ - /* ignore comments by default */ ignore_tag_items[TAG_COMMENT] = true; - - value = config_get_string(CONF_METADATA_TO_USE, nullptr); - if (value == nullptr) - return; - - memset(ignore_tag_items, true, TAG_NUM_OF_ITEM_TYPES); - - if (0 == g_ascii_strcasecmp(value, "none")) - return; - - temp = c = s = g_strdup(value); - while (!quit) { - if (*s == ',' || *s == '\0') { - if (*s == '\0') - quit = 1; - *s = '\0'; - - c = g_strstrip(c); - if (*c == 0) - continue; - - type = tag_name_parse_i(c); - if (type == TAG_NUM_OF_ITEM_TYPES) - FormatFatalError("error parsing metadata item \"%s\"", - c); - - ignore_tag_items[type] = false; - - s++; - c = s; - } - s++; - } - - g_free(temp); } void -- cgit v1.2.3