diff options
author | Maciej Stachowiak <mstachow@src.gnome.org> | 2001-02-06 23:46:36 +0000 |
---|---|---|
committer | Maciej Stachowiak <mstachow@src.gnome.org> | 2001-02-06 23:46:36 +0000 |
commit | c80972e67178ce5a09be8db230c6311d120658d8 (patch) | |
tree | 7ec9b00679098a2971aea89f355972a33da86941 | |
parent | b450cc9ef5c252dece99007a4e91550e991f8ba3 (diff) | |
download | nautilus-c80972e67178ce5a09be8db230c6311d120658d8.tar.gz |
reviewed by: Laszlo Kovacs <laszlo.kovacs@sun.com>
Fixed bug 795 (help component installs files in nautilus prefix,
but uses gnome-libs prefix to find them later) by expanding the
set of places Nautilus looks for help files.
* components/help/hyperbola-filefmt.c:
(fmt_man_populate_tree_for_subdir): Changed to look in more places
for help files: the help directory in the gnome prefix, the help
directory in the nautilus prefix, and directories in GNOME_PATH.
(fmt_help_populate_tree): New helper function.
(append_help_dir_if_exists): New helper function.
* components/help/Makefile.am: Define DATADIR in compile flags.
* components/help/hyperbola-main.c: Add copyright notice.
This part not reviewed:
* .cvsignore, libnautilus-extensions/.cvsignore: gnore more
things.
* Makefile.am: distribute .in versions of xml-i18n-tools.
-rw-r--r-- | .cvsignore | 3 | ||||
-rw-r--r-- | ChangeLog | 26 | ||||
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | components/help/Makefile.am | 1 | ||||
-rw-r--r-- | components/help/hyperbola-filefmt.c | 66 | ||||
-rw-r--r-- | components/help/hyperbola-main.c | 21 | ||||
-rw-r--r-- | libnautilus-extensions/.cvsignore | 4 | ||||
-rw-r--r-- | libnautilus-private/.cvsignore | 4 |
8 files changed, 119 insertions, 12 deletions
diff --git a/.cvsignore b/.cvsignore index da53c995a..9c8780841 100644 --- a/.cvsignore +++ b/.cvsignore @@ -23,5 +23,8 @@ po stamp-h stamp-h.in xml-i18n-extract +xml-i18n-extract.in xml-i18n-merge +xml-i18n-merge.in xml-i18n-update +xml-i18n-update.in @@ -1,3 +1,29 @@ +2001-02-06 Maciej Stachowiak <mjs@eazel.com> + + reviewed by: Laszlo Kovacs <laszlo.kovacs@sun.com> + + Fixed bug 795 (help component installs files in nautilus prefix, + but uses gnome-libs prefix to find them later) by expanding the + set of places Nautilus looks for help files. + + * components/help/hyperbola-filefmt.c: + (fmt_man_populate_tree_for_subdir): Changed to look in more places + for help files: the help directory in the gnome prefix, the help + directory in the nautilus prefix, and directories in GNOME_PATH. + (fmt_help_populate_tree): New helper function. + (append_help_dir_if_exists): New helper function. + + * components/help/Makefile.am: Define DATADIR in compile flags. + + * components/help/hyperbola-main.c: Add copyright notice. + + This part not reviewed: + + * .cvsignore, libnautilus-extensions/.cvsignore: gnore more + things. + + * Makefile.am: distribute .in versions of xml-i18n-tools. + 2001-02-06 John Sullivan <sullivan@eazel.com> reviewed by: <delete if not using a buddy> diff --git a/Makefile.am b/Makefile.am index dfbe8fd60..8637e7f09 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,9 +42,9 @@ EXTRA_DIST= \ ChangeLog-20000625 \ ChangeLog-20000831 \ ChangeLog-20001018 \ - xml-i18n-extract \ - xml-i18n-merge \ - xml-i18n-update \ + xml-i18n-extract.in \ + xml-i18n-merge.in \ + xml-i18n-update.in \ Makefile.shared \ $(DESKTOP_IN_FILES) \ $(DESKTOP_FILES) \ diff --git a/components/help/Makefile.am b/components/help/Makefile.am index 191216d5a..4d718e6c0 100644 --- a/components/help/Makefile.am +++ b/components/help/Makefile.am @@ -13,6 +13,7 @@ INCLUDES = \ $(GCONF_CFLAGS) \ $(VFS_CFLAGS) \ $(XML_CFLAGS) \ + -DPREFIX=\""$(prefix)"\" \ -DHYPERBOLA_DATADIR=\""$(datadir)/hyperbola"\" \ -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ -DINFODIR=\"$(infodir)\" diff --git a/components/help/hyperbola-filefmt.c b/components/help/hyperbola-filefmt.c index 419a2cc20..af383edae 100644 --- a/components/help/hyperbola-filefmt.c +++ b/components/help/hyperbola-filefmt.c @@ -1,5 +1,8 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */ + /* - * Portions Copyright (C) 2000 Sun Microsystems, Inc. + * Copyright (C) 2000 Sun Microsystems, Inc. + * Copyright (C) 2001 Eazel, Inc. * * This module is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,10 +20,14 @@ */ #include <config.h> + #include <gnome.h> -#include <zlib.h> #include "hyperbola-filefmt.h" + +#include <libnautilus-extensions/nautilus-glib-extensions.h> + +#include <zlib.h> #include <dirent.h> #include <regex.h> #include <limits.h> @@ -377,8 +384,9 @@ man_name_without_suffix (const char *filename) } static void -fmt_man_populate_tree_for_subdir (HyperbolaDocTree * tree, - const char *basedir, char **defpath, +fmt_man_populate_tree_for_subdir (HyperbolaDocTree *tree, + const char *basedir, + char **defpath, char secnum) { DIR *dirh; @@ -803,20 +811,64 @@ fmt_help_populate_tree_from_subdir (HyperbolaDocTree * tree, #endif #ifndef ENABLE_SCROLLKEEPER_SUPPORT +static GList * +append_help_dir_if_exists (GList *list, + char *prefix) +{ + char *help_dir; + + help_dir = g_concat_dir_and_file (prefix, "share/gnome/help"); + + if (g_file_test (help_dir, G_FILE_TEST_ISDIR)) { + list = g_list_append (list, help_dir); + } else { + g_free (help_dir); + } + + return list; +} + static void fmt_help_populate_tree (HyperbolaDocTree * tree) { char *app_path[] = { N_("Applications"), NULL }; char *dirname; + char *gnome_path; + char **pathdirs; + int i; + GList *node; + GList *help_directories; translate_array (app_path); make_treesection (tree, app_path); + help_directories = NULL; + dirname = gnome_datadir_file ("gnome/help"); - if (dirname) - fmt_help_populate_tree_from_subdir (tree, dirname, app_path); - g_free (dirname); + if (dirname != NULL) { + help_directories = g_list_append (help_directories, dirname); + } + + help_directories = append_help_dir_if_exists (help_directories, PREFIX); + + gnome_path = g_getenv ("GNOME_PATH"); + + if (gnome_path != NULL) { + pathdirs = g_strsplit (gnome_path, ":", INT_MAX); + + for (i = 0; pathdirs[i] != NULL; i++) { + help_directories = append_help_dir_if_exists (help_directories, + pathdirs[i]); + } + g_strfreev (pathdirs); + } + + for (node = help_directories; node != NULL; node = node->next) { + fmt_help_populate_tree_from_subdir (tree, node->data, app_path); + } + + nautilus_g_list_free_deep (help_directories); } #endif diff --git a/components/help/hyperbola-main.c b/components/help/hyperbola-main.c index 31f9bab0b..3aa30c2a8 100644 --- a/components/help/hyperbola-main.c +++ b/components/help/hyperbola-main.c @@ -1,3 +1,24 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */ + +/* + * Copyright (C) 2000 Red Hat, Inc. + * Copyright (C) 2000, 2001 Eazel, Inc. + * + * Nautilus is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * Nautilus is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ #include <config.h> diff --git a/libnautilus-extensions/.cvsignore b/libnautilus-extensions/.cvsignore index 1b6afbec8..89d7dd9e4 100644 --- a/libnautilus-extensions/.cvsignore +++ b/libnautilus-extensions/.cvsignore @@ -10,4 +10,6 @@ libnautilus-extensions.la fsextension.h fsextension_idl_stamp nautilus-undo-manager-component.h -nautilus_undo_manager_component_idl_stamp
\ No newline at end of file +nautilus_undo_manager_component_idl_stamp +nautilus-metafile-server.h +nautilus_metafile_server_idl_stamp diff --git a/libnautilus-private/.cvsignore b/libnautilus-private/.cvsignore index 1b6afbec8..89d7dd9e4 100644 --- a/libnautilus-private/.cvsignore +++ b/libnautilus-private/.cvsignore @@ -10,4 +10,6 @@ libnautilus-extensions.la fsextension.h fsextension_idl_stamp nautilus-undo-manager-component.h -nautilus_undo_manager_component_idl_stamp
\ No newline at end of file +nautilus_undo_manager_component_idl_stamp +nautilus-metafile-server.h +nautilus_metafile_server_idl_stamp |