fix: Correct type for module interval

This commit is contained in:
Michael Carlberg 2016-12-31 03:04:01 +01:00
parent a989d401d9
commit 14958bdd23
9 changed files with 9 additions and 9 deletions

View File

@ -37,7 +37,7 @@ namespace modules {
}
protected:
interval_t m_interval{1};
interval_t m_interval{1.0};
};
}

View File

@ -16,7 +16,7 @@ namespace modules {
template class module<cpu_module>;
cpu_module::cpu_module(const bar_settings& bar, string name_) : timer_module<cpu_module>(bar, move(name_)) {
m_interval = m_conf.get(name(), "interval", 1s);
m_interval = m_conf.get<decltype(m_interval)>(name(), "interval", 1s);
m_formatter->add(DEFAULT_FORMAT, TAG_LABEL, {TAG_LABEL, TAG_BAR_LOAD, TAG_RAMP_LOAD, TAG_RAMP_LOAD_PER_CORE});

View File

@ -22,7 +22,7 @@ namespace modules {
throw module_error("No date or time format specified");
}
m_interval = m_conf.get(name(), "interval", 1s);
m_interval = m_conf.get<decltype(m_interval)>(name(), "interval", 1s);
m_formatter->add(DEFAULT_FORMAT, TAG_LABEL, {TAG_LABEL, TAG_DATE});

View File

@ -26,7 +26,7 @@ namespace modules {
m_remove_unmounted = m_conf.get(name(), "remove-unmounted", m_remove_unmounted);
m_fixed = m_conf.get(name(), "fixed-values", m_fixed);
m_spacing = m_conf.get(name(), "spacing", m_spacing);
m_interval = m_conf.get(name(), "interval", 30s);
m_interval = m_conf.get<decltype(m_interval)>(name(), "interval", 30s);
// Add formats and elements
m_formatter->add(

View File

@ -14,7 +14,7 @@ namespace modules {
github_module::github_module(const bar_settings& bar, string name_)
: timer_module<github_module>(bar, move(name_)), m_http(http_util::make_downloader()) {
m_accesstoken = m_conf.get(name(), "token");
m_interval = m_conf.get(name(), "interval", 60s);
m_interval = m_conf.get<decltype(m_interval)>(name(), "interval", 60s);
m_empty_notifications = m_conf.get(name(), "empty-notifications", m_empty_notifications);
m_formatter->add(DEFAULT_FORMAT, TAG_LABEL, {TAG_LABEL});

View File

@ -15,7 +15,7 @@ namespace modules {
template class module<memory_module>;
memory_module::memory_module(const bar_settings& bar, string name_) : timer_module<memory_module>(bar, move(name_)) {
m_interval = m_conf.get(name(), "interval", 1s);
m_interval = m_conf.get<decltype(m_interval)>(name(), "interval", 1s);
m_formatter->add(DEFAULT_FORMAT, TAG_LABEL, {TAG_LABEL, TAG_BAR_USED, TAG_BAR_FREE});

View File

@ -19,7 +19,7 @@ namespace modules {
m_ping_nth_update = m_conf.get(name(), "ping-interval", m_ping_nth_update);
m_udspeed_minwidth = m_conf.get(name(), "udspeed-minwidth", m_udspeed_minwidth);
m_accumulate = m_conf.get(name(), "accumulate-stats", m_accumulate);
m_interval = m_conf.get(name(), "interval", 1s);
m_interval = m_conf.get<decltype(m_interval)>(name(), "interval", 1s);
m_conf.warn_deprecated(name(), "udspeed-minwidth", "%downspeed:min:max% and %upspeed:min:max%");

View File

@ -13,7 +13,7 @@ namespace modules {
m_tail = m_conf.get(name(), "tail", m_tail);
m_maxlen = m_conf.get(name(), "maxlen", m_maxlen);
m_ellipsis = m_conf.get(name(), "ellipsis", m_ellipsis);
m_interval = m_conf.get(name(), "interval", m_tail ? 0s : 5s);
m_interval = m_conf.get<decltype(m_interval)>(name(), "interval", m_tail ? 0s : 5s);
m_conf.warn_deprecated(
name(), "maxlen", "\"format = <label>\" and \"label = %output:0:" + to_string(m_maxlen) + "%\"");

View File

@ -16,7 +16,7 @@ namespace modules {
: timer_module<temperature_module>(bar, move(name_)) {
m_zone = m_conf.get(name(), "thermal-zone", 0);
m_tempwarn = m_conf.get(name(), "warn-temperature", 80);
m_interval = m_conf.get(name(), "interval", 1s);
m_interval = m_conf.get<decltype(m_interval)>(name(), "interval", 1s);
m_path = string_util::replace(PATH_TEMPERATURE_INFO, "%zone%", to_string(m_zone));