From 8c3f40db5b16ae2612c30190eb466c7186fb4414 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Wed, 14 Dec 2016 07:46:37 +0100 Subject: [PATCH] refactor(eventloop): Use config wrapper --- include/components/config.hpp | 1 + include/components/eventloop.hpp | 2 +- src/components/eventloop.cpp | 8 +++----- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/components/config.hpp b/include/components/config.hpp index a0a8f1cd..3ff48818 100644 --- a/include/components/config.hpp +++ b/include/components/config.hpp @@ -17,6 +17,7 @@ using boost::none; #define GET_CONFIG_VALUE(section, var, name) var = m_conf.get(section, name, var) #define REQ_CONFIG_VALUE(section, var, name) var = m_conf.get(section, name) +#define DEPR_CONFIG_VALUE(section, var, old, name) var = m_conf.deprecated(section, old, name, var) DEFINE_ERROR(value_error); DEFINE_ERROR(key_error); diff --git a/include/components/eventloop.hpp b/include/components/eventloop.hpp index ee15f717..d3ff2804 100644 --- a/include/components/eventloop.hpp +++ b/include/components/eventloop.hpp @@ -119,7 +119,7 @@ class eventloop : public signal_receiver("settings", "eventloop-swallow", "throttle-output", m_swallow_limit); - m_swallow_update = m_conf.deprecated( - "settings", "eventloop-swallow-time", "throttle-output-for", m_swallow_update); - m_swallow_input = - m_conf.get("settings", "throttle-input-for", m_swallow_update * m_swallow_limit); + GET_CONFIG_VALUE("settings", m_swallow_input, "throttle-input-for"); + DEPR_CONFIG_VALUE("settings", m_swallow_limit, "eventloop-swallow", "throttle-output"); + DEPR_CONFIG_VALUE("settings", m_swallow_update, "eventloop-swallow-time", "throttle-output-for"); m_sig.attach(this); }