From 3559d2c2a32f0eeca441a5d7581064101503d16a Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Thu, 20 Mar 2014 21:53:42 +0100 Subject: Use setup2.xml if present To allow combined use of different cgg versions, user may provide ver. 2 setup.xml file that takes priority over standard setup.xml file. This applies only to current working directory, not the files placed in ~/.cgg or distributed as $PREFIX/share/cgg. --- src/setup.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/setup.c') diff --git a/src/setup.c b/src/setup.c index bb69993..d9b5ed3 100644 --- a/src/setup.c +++ b/src/setup.c @@ -41,16 +41,21 @@ find_setup_xml () { gchar *pth; gchar *cwd; - TGallerySetup *setup; + TGallerySetup *setup = NULL; - setup = NULL; cwd = g_get_current_dir (); - pth = g_build_filename (cwd, SETUP_XML, NULL); - g_free (cwd); - + /* Prefer setup2.xml over setup.xml but only in current working directory */ + pth = g_build_filename (cwd, SETUP_V2_XML, NULL); if (g_access (pth, R_OK) == 0) setup = parse_setup_xml (pth); g_free (pth); + if (! setup) { + pth = g_build_filename (cwd, SETUP_XML, NULL); + if (g_access (pth, R_OK) == 0) + setup = parse_setup_xml (pth); + g_free (pth); + } + g_free (cwd); if (! setup) { pth = g_build_filename (g_getenv ("HOME"), ".cgg", SETUP_XML, NULL); -- cgit v1.2.3