]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
mdhelp: reuse class doc from parent
authorJaroslav Kysela <perex@perex.cz>
Thu, 14 Apr 2016 09:01:09 +0000 (11:01 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 14 Apr 2016 09:01:09 +0000 (11:01 +0200)
src/idnode.c
src/idnode.h
src/webui/doc_md.c

index cf8f67fd4c9b93a6afc375668607edd40aa8ca88..0ab7977532c89239bbf8c8675d1920b8bb12ca4b 100644 (file)
@@ -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)
 {
index f30ba6a1706ba979be4ef5d780cdfdda37124aeb..0db8c99147f356f4f7648b3093e26efd9f7344c2 100644 (file)
@@ -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);
index add004842f9286824926e196b68b5aa457fbe326..3acda5fa7589aa7d1bfb355742a0eb163bf5321e 100644 (file)
@@ -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");