refactor(tokens): Move token suffix to configuration

This commit is contained in:
Michael Carlberg
2017-01-13 20:03:08 +01:00
parent b395285a68
commit 3292cea786
14 changed files with 79 additions and 46 deletions

View File

@ -31,7 +31,7 @@ namespace modules {
m_formatter->add(DEFAULT_FORMAT, TAG_LABEL, {TAG_LABEL, TAG_BAR, TAG_RAMP});
if (m_formatter->has(TAG_LABEL)) {
m_label = load_optional_label(m_conf, name(), TAG_LABEL, "%percentage%");
m_label = load_optional_label(m_conf, name(), TAG_LABEL, "%percentage%%");
}
if (m_formatter->has(TAG_BAR)) {
m_progressbar = load_progressbar(m_bar, m_conf, name(), TAG_BAR);
@ -61,7 +61,7 @@ namespace modules {
if (m_label) {
m_label->reset_tokens();
m_label->replace_token("%percentage%", to_string(m_percentage) + "%");
m_label->replace_token("%percentage%", to_string(m_percentage));
}
return true;