summaryrefslogtreecommitdiff
path: root/src/configuration.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/configuration.h')
-rw-r--r--src/configuration.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/configuration.h b/src/configuration.h
index 69a211be..e0ffae51 100644
--- a/src/configuration.h
+++ b/src/configuration.h
@@ -261,4 +261,17 @@ extern Config config;
extern Configuration branding;
extern Configuration paths;
+/**
+ * Sets the given Config member and sends a change event.
+ */
+template<typename T>
+void setConfigValue(T Config::*member, const T &value)
+{
+ if (config.*member == value)
+ return;
+
+ config.*member = value;
+ Event(Event::ConfigOptionChanged, member).trigger(Event::ConfigChannel);
+}
+
#endif