Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mdhelp: reuse class doc from parent
  • Loading branch information
perexg committed Apr 14, 2016
1 parent f0707ad commit c75bb4b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/idnode.c
Expand Up @@ -1298,6 +1298,17 @@ idclass_get_order (const idclass_t *idc)
return NULL;
}

const char **
idclass_get_doc (const idclass_t *idc)
{
while (idc) {
if (idc->ic_doc)
return idc->ic_doc;
idc = idc->ic_super;
}
return NULL;
}

static htsmsg_t *
idclass_get_property_groups (const idclass_t *idc, const char *lang)
{
Expand Down
1 change: 1 addition & 0 deletions src/idnode.h
Expand Up @@ -227,6 +227,7 @@ void idclass_register ( const idclass_t *idc );
const idclass_t *idclass_find ( const char *name );
idclass_t const **idclass_find_all(void);
idclass_t const **idclass_find_children(const char *name);
const char **idclass_get_doc(const idclass_t *idc);
const char *idclass_get_caption ( const idclass_t *idc, const char *lang );
htsmsg_t *idclass_serialize0 (const idclass_t *idc, htsmsg_t *list, int optmask, const char *lang);
htsmsg_t *idnode_serialize0 (idnode_t *self, htsmsg_t *list, int optmask, const char *lang);
Expand Down
2 changes: 1 addition & 1 deletion src/webui/doc_md.c
Expand Up @@ -139,7 +139,7 @@ http_markdown_class(http_connection_t *hc, const char *clazz)
pthread_mutex_unlock(&global_lock);
return HTTP_STATUS_NOT_FOUND;
}
doc = ic->ic_doc;
doc = idclass_get_doc(ic);
m = idclass_serializedoc(ic, lang);
pthread_mutex_unlock(&global_lock);
s = htsmsg_get_str(m, "caption");
Expand Down

0 comments on commit c75bb4b

Please sign in to comment.