Config::valueUpdated only emitted if value changed

This commit is contained in:
Tobias Blomberg 2020-11-28 00:29:04 +01:00
parent 4c85168a70
commit 783954aca3
4 changed files with 9 additions and 4 deletions

View File

@ -29,6 +29,7 @@
* Added an AudioContainer framework.
* The Config::valueUpdated signal is now only emitted if the value is changed.
1.6.0 -- 01 Sep 2019

View File

@ -224,8 +224,11 @@ void Config::setValue(const std::string& section, const std::string& tag,
const std::string& value)
{
Values &values = sections[section];
values[tag] = value;
valueUpdated(section, tag);
if (value != values[tag])
{
values[tag] = value;
valueUpdated(section, tag);
}
} /* Config::setValue */

View File

@ -427,7 +427,8 @@ class Config
* @param tag The tag (variable name) of the update
*
* This signal is emitted whenever a configuration variable is changed
* by calling the setValue function.
* by calling the setValue function. It will only be emitted if the value
* actually changes.
*/
sigc::signal<void, const std::string&, const std::string&> valueUpdated;

View File

@ -8,7 +8,7 @@ QTEL=1.2.4
LIBECHOLIB=1.3.3
# Version for the Async library
LIBASYNC=1.6.0.99.10
LIBASYNC=1.6.0.99.11
# SvxLink versions
SVXLINK=1.7.99.25