aboutsummaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-07-05 15:57:53 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-07-05 15:57:53 +0200
commit3a922c3c1acd08bc59ffec419aa555cbecb1f3da (patch)
tree87abb9ea4425850243dfe3970d00ba14a16cca36 /common.c
parent34c1df5171a911ae1ffcaa7a796204eab2573359 (diff)
downloadxK-3a922c3c1acd08bc59ffec419aa555cbecb1f3da.tar.gz
xK-3a922c3c1acd08bc59ffec419aa555cbecb1f3da.tar.xz
xK-3a922c3c1acd08bc59ffec419aa555cbecb1f3da.zip
degesch: start using "on_change" notifications
Terminal attributes can be changed on the fly now.
Diffstat (limited to 'common.c')
-rw-r--r--common.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/common.c b/common.c
index b116266..95590f5 100644
--- a/common.c
+++ b/common.c
@@ -1911,8 +1911,6 @@ config_schema_initialize_item (struct config_schema *schema,
item->schema = schema;
item->user_data = user_data;
- if (schema->on_change)
- schema->on_change (item);
}
static void
@@ -1924,6 +1922,22 @@ config_schema_apply_to_object (struct config_schema *schema_array,
config_schema_initialize_item (schema_array++, object, user_data);
}
+static void
+config_schema_call_changed (struct config_item_ *item)
+{
+ if (item->type == CONFIG_ITEM_OBJECT)
+ {
+ struct str_map_iter iter;
+ str_map_iter_init (&iter, &item->value.object);
+
+ struct config_item_ *child;
+ while ((child = str_map_iter_next (&iter)))
+ config_schema_call_changed (child);
+ }
+ else if (item->schema && item->schema->on_change)
+ item->schema->on_change (item);
+}
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// XXX: this doesn't necessarily have to be well designed at all