diff src/rcfile.c @ 743:77ff94c0490a

Try to load a system-wide rc file if any, before per-user rc file. For now, system-wide rc file path is set to /etc/geeqie/geeqierc (defined by GQ_SYSTEM_WIDE_DIR in main.h). filter_parse() was modified to replace entries having the same key, needed since it may be called more than once. Please test heavily.
author zas_
date Fri, 23 May 2008 00:20:56 +0000
parents a336b5545af6
children ae618ebec3e9
line wrap: on
line diff
--- a/src/rcfile.c	Thu May 22 23:22:12 2008 +0000
+++ b/src/rcfile.c	Fri May 23 00:20:56 2008 +0000
@@ -924,9 +924,19 @@
 
 void load_options(ConfOptions *options)
 {
+	gboolean success;
 	gchar *rc_path;
 
+	if (isdir(GQ_SYSTEM_WIDE_DIR))
+		{
+		rc_path = g_build_filename(GQ_SYSTEM_WIDE_DIR, RC_FILE_NAME, NULL);
+		success = load_options_from(rc_path, options);
+		DEBUG_1("Loading options from %s ... %s", rc_path, success ? "done" : "failed");
+		g_free(rc_path);
+		}
+	
 	rc_path = g_build_filename(homedir(), GQ_RC_DIR, RC_FILE_NAME, NULL);
-	load_options_from(rc_path, options);
+	success = load_options_from(rc_path, options);
+	DEBUG_1("Loading options from %s ... %s", rc_path, success ? "done" : "failed");
 	g_free(rc_path);
 }