idnode: fix bug in config saving, not calling callback properly
This commit is contained in:
parent
6924fbc032
commit
09abad751e
1 changed files with 14 additions and 2 deletions
16
src/idnode.c
16
src/idnode.c
|
@ -622,15 +622,27 @@ idnode_class_write_values
|
|||
return save;
|
||||
}
|
||||
|
||||
static void
|
||||
idnode_savefn ( idnode_t *self )
|
||||
{
|
||||
const idclass_t *idc = self->in_class;
|
||||
while (idc) {
|
||||
if (idc->ic_save) {
|
||||
idc->ic_save(self);
|
||||
break;
|
||||
}
|
||||
idc = idc->ic_super;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
idnode_write0 ( idnode_t *self, htsmsg_t *c, int optmask, int dosave )
|
||||
{
|
||||
int save = 0;
|
||||
const idclass_t *idc = self->in_class;
|
||||
void (*savefn)(idnode_t*) = idc->ic_save;
|
||||
save = idnode_class_write_values(self, idc, c, optmask);
|
||||
if (save && dosave) {
|
||||
if (savefn) savefn(self);
|
||||
idnode_savefn(self);
|
||||
idnode_notify(self, NULL, 0, 0);
|
||||
}
|
||||
return save;
|
||||
|
|
Loading…
Add table
Reference in a new issue