summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Hallendal <micke@codefactory.se>2002-03-03 17:10:42 +0000
committerMikael Hallendal <hallski@src.gnome.org>2002-03-03 17:10:42 +0000
commit2bcc93ab7dcb30724c40f6ad3233a461465606ab (patch)
tree424d603187df12629bac1217d2996902cde16ef8
parent24adb4e3959db0814f3ab051971050ca5ae90464 (diff)
downloadyelp-2bcc93ab7dcb30724c40f6ad3233a461465606ab.tar.gz
added casting macro YELP_SECTION.
2002-03-03 Mikael Hallendal <micke@codefactory.se> * src/yelp-section.h: added casting macro YELP_SECTION. * src/yelp-base.c (yelp_base_new): pass index-list to info init. * src/yelp-info.c (yelp_info_init): - Fixes #73291 - added index-list to argument. - add info pages to index-list.
-rw-r--r--ChangeLog9
-rw-r--r--src/yelp-base.c4
-rw-r--r--src/yelp-info.c16
-rw-r--r--src/yelp-info.h3
-rw-r--r--src/yelp-section.h2
5 files changed, 30 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0dcb0c52..e28b75a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2002-03-03 Mikael Hallendal <micke@codefactory.se>
+ * src/yelp-section.h: added casting macro YELP_SECTION.
+
+ * src/yelp-base.c (yelp_base_new): pass index-list to info init.
+
+ * src/yelp-info.c (yelp_info_init):
+ - Fixes #73291
+ - added index-list to argument.
+ - add info pages to index-list.
+
* src/yelp-view-toc.c (yelp_view_toc_start):
- Fixes #72146
- Don't show "Other documents" if neither man or info are
diff --git a/src/yelp-base.c b/src/yelp-base.c
index 777ec001..8bcdfb0e 100644
--- a/src/yelp-base.c
+++ b/src/yelp-base.c
@@ -170,9 +170,9 @@ yelp_base_new (void)
base = g_object_new (YELP_TYPE_BASE, NULL);
priv = base->priv;
- yelp_scrollkeeper_init (priv->toc_tree, (&priv->index));
+ yelp_scrollkeeper_init (priv->toc_tree, &priv->index);
yelp_man_init (base->priv->toc_tree);
- yelp_info_init (base->priv->toc_tree);
+ yelp_info_init (base->priv->toc_tree, &priv->index);
return base;
}
diff --git a/src/yelp-info.c b/src/yelp-info.c
index 4626c0d5..91758aa5 100644
--- a/src/yelp-info.c
+++ b/src/yelp-info.c
@@ -96,13 +96,16 @@ yelp_info_read_info_dir (const char *basedir, GSList **info_list)
}
gboolean
-yelp_info_init (GNode *tree)
+yelp_info_init (GNode *tree, GList **index)
{
GNode *root;
struct stat stat_dir1;
struct stat stat_dir2;
GSList *info_list = NULL;
GSList *node;
+ YelpSection *section;
+ YelpSection *index_section;
+ gchar *index_uri;
stat ("/usr/info", &stat_dir1);
stat ("/usr/share/info", &stat_dir2);
@@ -126,6 +129,17 @@ yelp_info_init (GNode *tree)
for (node = info_list; node; node = node->next) {
g_node_append_data (root, node->data);
+ section = YELP_SECTION (node->data);
+
+ index_uri = g_strconcat ("index:", section->uri, NULL);
+
+ index_section = yelp_section_new (YELP_SECTION_INDEX,
+ section->name, index_uri,
+ section->reference,
+ section->scheme);
+ g_free (index_uri);
+
+ *index = g_list_prepend (*index, index_section);
}
g_slist_free (info_list);
diff --git a/src/yelp-info.h b/src/yelp-info.h
index 1cd0b62d..fa1c7233 100644
--- a/src/yelp-info.h
+++ b/src/yelp-info.h
@@ -25,6 +25,7 @@
#include <glib.h>
-gboolean yelp_info_init (GNode *tree);
+gboolean yelp_info_init (GNode *tree,
+ GList **index);
#endif /* __YELP_INFO_H__ */
diff --git a/src/yelp-section.h b/src/yelp-section.h
index eab4dcdf..56dd609a 100644
--- a/src/yelp-section.h
+++ b/src/yelp-section.h
@@ -27,6 +27,8 @@
typedef struct _YelpSection YelpSection;
+#define YELP_SECTION(x) ((YelpSection *) x)
+
typedef enum {
YELP_SECTION_DOCUMENT_SECTION,
YELP_SECTION_DOCUMENT,