From dceb9f7d6058785cf60d9dbcc8eecdcee1053412 Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 23 Nov 2014 13:40:43 +0100 Subject: Implement proper font handling --- src/settings.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/settings.cpp') diff --git a/src/settings.cpp b/src/settings.cpp index 65896ef27..001d93f5e 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -620,6 +620,13 @@ void Settings::update(const Settings &other) } +void Settings::registerChangedCallback(std::string name, + setting_changed_callback cbf) +{ + m_callbacks[name].push_back(cbf); +} + + inline bool Settings::parseConfigObject(std::istream &is, std::string &name, std::string &value) { @@ -701,3 +708,20 @@ void Settings::clearNoLock() m_defaults.clear(); } +void Settings::doCallbacks(const std::string name) +{ + std::vector tempvector; + { + JMutexAutoLock lock(m_mutex); + if (m_callbacks.find(name) != m_callbacks.end()) + { + tempvector = m_callbacks[name]; + } + } + + for (std::vector::iterator iter = tempvector.begin(); + iter != tempvector.end(); iter ++) + { + (*iter)(name); + } +} -- cgit v1.2.3