Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 2546ffb3ea49dcdd93d428c76e1814be > files > 31

gnome-libs-1.4.2-18.fc15.src.rpm

--- gnome-libs-1.0.55/libgnomeui/Makefile.am.gtkrc	Wed Oct 20 08:44:29 1999
+++ gnome-libs-1.0.55/libgnomeui/Makefile.am	Fri Feb 11 16:34:15 2000
@@ -20,6 +20,7 @@
 	$(AUDIOFILE_CFLAGS) $(ESD_CFLAGS) \
         -DGNOMELIBDIR=\""$(libdir)"\" \
         -DGNOMEDATADIR=\""$(datadir)"\" \
+	-DGNOMECONFDIR=\""$(sysconfdir)/gnome"\" \
         -DGNOMEBINDIR=\""$(bindir)"\" \
         -DGNOMELOCALSTATEDIR=\""$(localstatedir)"\" \
         -DGNOMELOCALEDIR=\""$(gnomelocaledir)"\" \
@@ -241,7 +242,7 @@
 SGML =	\
 	gtk-ted.sgml
 
-gtkrcdir = $(datadir)
+gtkrcdir = $(sysconfdir)/gnome
 gtkrc_DATA = gtkrc gtkrc.el gtkrc.eo gtkrc.he gtkrc.hy gtkrc.ja \
 	gtkrc.ko gtkrc.ru gtkrc.tr gtkrc.th gtkrc.uk \
 	gtkrc.iso88592 gtkrc.iso88595 gtkrc.zh_CN gtkrc.zh_TW.Big5 \
--- gnome-libs-1.0.55/libgnomeui/gnome-init.c.gtkrc	Thu Jan  6 18:07:03 2000
+++ gnome-libs-1.0.55/libgnomeui/gnome-init.c	Fri Feb 11 16:34:15 2000
@@ -48,6 +48,79 @@
 #include <locale.h>
 #endif
 
+#define TEMPORARY_CUT_AND_PASTE_HACK
+#ifdef TEMPORARY_CUT_AND_PASTE_HACK
+/* This is cut-and-pasted from libgnome to avoid adding
+   API in the stable branch. */
+
+static char *
+gnome_dirrelative_file (const char *base, const char *sub, const char *filename, int unconditional)
+{
+        static char *gnomedir = NULL;
+	char *dir = NULL, *fil = NULL, *odir = NULL, *ofil = NULL;
+	char *retval = NULL;
+	
+	/* First try the env GNOMEDIR relative path */
+	if(!gnomedir)
+	  gnomedir = getenv ("GNOMEDIR");
+	
+	if (gnomedir) {
+		dir = g_concat_dir_and_file (gnomedir, sub);
+		fil = g_concat_dir_and_file (dir, filename);
+
+		if (g_file_exists (fil)) {
+			retval = fil; fil = NULL; goto out;
+		}
+
+		odir = dir; ofil = fil;
+		dir = g_concat_dir_and_file (gnome_util_user_home (), sub);
+		fil = g_concat_dir_and_file (dir, filename);
+
+		if (strcmp (odir, dir) != 0 && g_file_exists (fil)) {
+			retval = fil; fil = NULL; goto out;
+		}
+
+		if (unconditional) {
+			retval = ofil; ofil = NULL; goto out;
+		}
+	}
+
+	if ((!dir || strcmp (base, dir) != 0)
+	    && (!odir || strcmp (base, odir) != 0)) {
+		/* Then try the hardcoded path */
+		g_free (fil);
+		fil = g_concat_dir_and_file (base, filename);
+		
+		if (unconditional || g_file_exists (fil)) {
+			retval = fil; fil = NULL; goto out;
+		}
+	}
+
+	/* Finally, attempt to find it in the current directory */
+	g_free (fil);
+	fil = g_concat_dir_and_file (".", filename);
+	
+	if (g_file_exists (fil)) {
+		retval = fil; fil = NULL; goto out;
+	}
+
+out:	
+	g_assert(retval || !unconditional);
+
+	g_free (dir); g_free (odir); g_free (fil); g_free (ofil);
+        
+	return retval;
+}
+
+static gchar*
+gnome_unconditional_gnomeconf_file(const gchar* filename)
+{
+	return (gnome_dirrelative_file (GNOMECONFDIR, "gnome", filename, TRUE));
+}
+
+#endif /* TEMPORARY_CUT_AND_PASTE_HACK */
+
+
 static void initialize_gtk_signal_relay(void);
 static gboolean
 relay_gtk_signal(GtkObject *object,
@@ -531,8 +604,8 @@
 	g_free(buf);
 	
 	
-	/* <gnomedatadir>/gtkrc */
-	file = gnome_unconditional_datadir_file("gtkrc");
+	/* <sysconfdir>/gnome/gtkrc */
+	file = gnome_unconditional_gnomeconf_file("gtkrc");
 	if (file){
 		gtk_rc_add_default_file (file);
 		g_free (file);