summaryrefslogtreecommitdiff
path: root/libyelp/yelp-document.c
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2010-03-21 14:03:12 -0500
committerShaun McCance <shaunm@gnome.org>2010-03-21 14:05:15 -0500
commitd3ecc826fea73ffcfe57bb30c0914616eb3fb97c (patch)
treedd46640bc7b0536256daa54f9d0b966e41e2cefa /libyelp/yelp-document.c
parentd03d4b79169fbec0a74ac387fca32a012f232f0e (diff)
downloadyelp-d3ecc826fea73ffcfe57bb30c0914616eb3fb97c.tar.gz
Set the window title based on the root page title
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)
{