bonobo UI prefixes



Hi,

gnome-terminal passes $(prefix) to bonobo_ui_util_set_ui(), which is
then concatted with gnome/ui, so it looks for the xml file in
prefix/gnome/ui instead of prefix/share/gnome/ui where g-t installs
it.

Not sure of the right fix, but one attempt is appended. OK to commit?

Havoc

Index: bonobo/bonobo-ui-util.c
===================================================================
RCS file: /cvs/gnome/libbonoboui/bonobo/bonobo-ui-util.c,v
retrieving revision 1.53
diff -u -p -u -r1.53 bonobo-ui-util.c
--- bonobo/bonobo-ui-util.c	2001/09/26 05:33:00	1.53
+++ bonobo/bonobo-ui-util.c	2001/10/09 20:43:59
@@ -517,7 +517,7 @@ bonobo_ui_util_build_help_menu (BonoboUI
 
 /**
  * bonobo_ui_util_get_ui_fname:
- * @component_prefix: the prefix for the component.
+ * @component_datadir: the datadir for the component, e.g. /usr/share
  * @file_name: the file name of the xml file.
  * 
  * Builds a path to the xml file that stores the GUI.
@@ -526,7 +526,7 @@ bonobo_ui_util_build_help_menu (BonoboUI
  * UI or NULL if it is not found.
  **/
 char *
-bonobo_ui_util_get_ui_fname (const char *component_prefix,
+bonobo_ui_util_get_ui_fname (const char *component_datadir,
 			     const char *file_name)
 {
 	char *fname, *name;
@@ -553,9 +553,9 @@ bonobo_ui_util_get_ui_fname (const char 
 	/*
 	 * The master copy
 	 */
-	if (component_prefix) {
+	if (component_datadir) {
 		fname = g_strdup_printf ("%s/gnome/ui/%s",
-					 component_prefix, file_name);
+					 component_datadir, file_name);
 		if (g_file_test (fname, G_FILE_TEST_EXISTS))
 			return fname;
 		g_free (fname);
@@ -789,7 +789,7 @@ free_loaded_node_cache (void)
 /**
  * bonobo_ui_util_set_ui:
  * @component: the component
- * @app_prefix: the application prefix eg. /opt/gnome
+ * @app_datadir: the application datadir eg. /opt/gnome/share
  * @file_name: the filename of the file to merge relative to the prefix.
  * @app_name: the application name - for help merging
  * 
@@ -800,7 +800,7 @@ free_loaded_node_cache (void)
  **/
 void
 bonobo_ui_util_set_ui (BonoboUIComponent *component,
-		       const char        *app_prefix,
+		       const char        *app_datadir,
 		       const char        *file_name,
 		       const char        *app_name)
 {
@@ -819,7 +819,7 @@ bonobo_ui_util_set_ui (BonoboUIComponent
 		return;
 	}
 	
-	fname = bonobo_ui_util_get_ui_fname (app_prefix, file_name);
+	fname = bonobo_ui_util_get_ui_fname (app_datadir, file_name);
 	if (!fname) {
 		g_warning ("Can't find '%s' to load ui from", file_name);
 		return;
@@ -836,7 +836,7 @@ bonobo_ui_util_set_ui (BonoboUIComponent
 		BonoboUINode *node;
 
 		node = bonobo_ui_util_new_ui (
-			component, fname, app_prefix, app_name);
+			component, fname, app_datadir, app_name);
 
 		ui = bonobo_ui_node_to_string (node, TRUE);
 


Index: configure.in
===================================================================
RCS file: /cvs/gnome/gnome-core/configure.in,v
retrieving revision 1.320
diff -u -p -u -r1.320 configure.in
--- configure.in	2001/10/05 15:52:45	1.320
+++ configure.in	2001/10/09 20:43:51
@@ -1,5 +1,3 @@
-AC_PREREQ(2.52)
-
 AC_INIT(panel)
 AM_CONFIG_HEADER(config.h)
 AM_INIT_AUTOMAKE(gnome-core, 1.5.0)
Index: gnome-terminal/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-core/gnome-terminal/Makefile.am,v
retrieving revision 1.30
diff -u -p -u -r1.30 Makefile.am
--- gnome-terminal/Makefile.am	2001/10/05 15:52:45	1.30
+++ gnome-terminal/Makefile.am	2001/10/09 20:43:52
@@ -9,6 +9,7 @@ INCLUDES = 						\
 	-I$(top_builddir)/intl				\
 	$(GNOME_TERMINAL_CFLAGS)			\
 	-DGNOME_TERMINAL_PREFIX=\""$(prefix)"\"		\
+	-DGNOME_TERMINAL_DATADIR=\""$(datadir)"\" 	\
 	-DGNOME_TERMINAL_GLADEDIR=\""$(gladedir)"\"	\
 	-DGNOMELOCALEDIR=\""$(datadir)/locale\""
 
Index: gnome-terminal/gnome-terminal.c
===================================================================
RCS file: /cvs/gnome/gnome-core/gnome-terminal/gnome-terminal.c,v
retrieving revision 1.202
diff -u -p -u -r1.202 gnome-terminal.c
--- gnome-terminal/gnome-terminal.c	2001/10/05 01:30:27	1.202
+++ gnome-terminal/gnome-terminal.c	2001/10/09 20:43:53
@@ -2267,7 +2267,7 @@ new_terminal_cmd (char **cmd, struct ter
 	bonobo_ui_component_set_container (uic, container, NULL);
 	
 	bonobo_ui_component_add_verb_list_with_data (uic, terminal_verbs, term);
-	bonobo_ui_util_set_ui (uic, GNOME_TERMINAL_PREFIX,
+	bonobo_ui_util_set_ui (uic, GNOME_TERMINAL_DATADIR,
 			       "gnome-terminal.xml", "gnome-terminal");
 	
 	bonobo_ui_component_add_listener (uic, "ToggleMenuBar", 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]