summaryrefslogtreecommitdiff
path: root/libyelp/yelp-document.c
diff options
context:
space:
mode:
Diffstat (limited to 'libyelp/yelp-document.c')
-rw-r--r--libyelp/yelp-document.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libyelp/yelp-document.c b/libyelp/yelp-document.c
index 74275523..3c79dc92 100644
--- a/libyelp/yelp-document.c
+++ b/libyelp/yelp-document.c
@@ -453,6 +453,29 @@ yelp_document_set_up_id (YelpDocument *document,
}
gchar *
+yelp_document_get_root_title (YelpDocument *document,
+ const gchar *page_id)
+{
+ gchar *real, *root, *ret = NULL;
+
+ g_assert (document != NULL && YELP_IS_DOCUMENT (document));
+
+ g_mutex_lock (document->priv->mutex);
+ real = hash_lookup (document->priv->page_ids, page_id);
+ if (real) {
+ root = hash_lookup (document->priv->root_ids, real);
+ if (root) {
+ ret = hash_lookup (document->priv->titles, root);
+ if (ret)
+ ret = g_strdup (ret);
+ }
+ }
+ g_mutex_unlock (document->priv->mutex);
+
+ return ret;
+}
+
+gchar *
yelp_document_get_page_title (YelpDocument *document,
const gchar *page_id)
{