idnode: Rename descriptors -> parameters

This commit is contained in:
Andreas Öman 2013-03-31 14:20:04 +02:00
parent 9b5d47e21a
commit 9414fd4d45
4 changed files with 15 additions and 15 deletions

View file

@ -171,10 +171,10 @@ idnode_unlink(idnode_t *in)
* Recursive to get superclass nodes first
*/
static void
add_descriptors(struct idnode *self, const idclass_t *ic, htsmsg_t *p)
add_params(struct idnode *self, const idclass_t *ic, htsmsg_t *p)
{
if(ic->ic_super != NULL)
add_descriptors(self, ic->ic_super, p);
add_params(self, ic->ic_super, p);
if(TAILQ_FIRST(&p->hm_fields) != NULL) {
// Only add separator if not empty
@ -184,7 +184,7 @@ add_descriptors(struct idnode *self, const idclass_t *ic, htsmsg_t *p)
htsmsg_add_msg(p, NULL, m);
}
prop_add_descriptors_to_msg(self, ic->ic_properties, p);
prop_add_params_to_msg(self, ic->ic_properties, p);
}
@ -218,9 +218,9 @@ idnode_serialize(struct idnode *self)
htsmsg_add_str(m, "text", idnode_get_title(self));
htsmsg_t *p = htsmsg_create_list();
add_descriptors(self, c, p);
add_params(self, c, p);
htsmsg_add_msg(m, "descriptors", p);
htsmsg_add_msg(m, "params", p);
htsmsg_add_str(m, "id", idnode_uuid_as_str(self));
}
@ -242,16 +242,16 @@ idnode_save(idnode_t *in)
}
}
// Tell about updated descriptors
// Tell about updated parameters
htsmsg_t *m = htsmsg_create_map();
htsmsg_add_str(m, "id", idnode_uuid_as_str(in));
htsmsg_t *p = htsmsg_create_list();
add_descriptors(in, in->in_class, p);
htsmsg_add_msg(m, "descriptors", p);
add_params(in, in->in_class, p);
htsmsg_add_msg(m, "params", p);
notify_by_msg("idnodeDescriptorsChanged", m);
notify_by_msg("idnodeParamsChanged", m);
}

View file

@ -135,7 +135,7 @@ const static struct strtab typetab[] = {
*
*/
void
prop_add_descriptors_to_msg(void *obj, const property_t *p, htsmsg_t *msg)
prop_add_params_to_msg(void *obj, const property_t *p, htsmsg_t *msg)
{
if(p == NULL)
return;

View file

@ -24,7 +24,7 @@ typedef struct property {
void prop_add_descriptors_to_msg(void *obj, const property_t *p, htsmsg_t *msg);
void prop_add_params_to_msg(void *obj, const property_t *p, htsmsg_t *msg);
void prop_write_values(void *ptr, const property_t *pl, htsmsg_t *m);

View file

@ -3,8 +3,8 @@ tvheadend.item_editor = function(item) {
var fields = []
for (var idx in item.descriptors) {
var f = item.descriptors[idx];
for (var idx in item.params) {
var f = item.params[idx];
switch(f.type) {
case 'str':
fields.push({
@ -105,10 +105,10 @@ tvheadend.dvb_networks = function() {
}
});
tvheadend.comet.on('idnodeDescriptorsChanged', function(o) {
tvheadend.comet.on('idnodeParamsChanged', function(o) {
var n = tree.getNodeById(o.id);
if(n) {
n.attributes.descriptors = o.descriptors;
n.attributes.params = o.params;
}
});