summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2014-03-20 21:53:42 +0100
committerTomas Bzatek <tbzatek@users.sourceforge.net>2014-03-21 10:08:21 +0100
commit3559d2c2a32f0eeca441a5d7581064101503d16a (patch)
tree3969f9f6d2f289e2b3050b2a644f90c7cea03baf /src
parentd3d5bb1dfc21ac30b77fc4484ff942d0a9100275 (diff)
downloadcataract-3559d2c2a32f0eeca441a5d7581064101503d16a.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/setup.c15
-rw-r--r--src/setup.h1
2 files changed, 11 insertions, 5 deletions
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);
diff --git a/src/setup.h b/src/setup.h
index 7ce2cd1..9e8f9dd 100644
--- a/src/setup.h
+++ b/src/setup.h
@@ -28,6 +28,7 @@ G_BEGIN_DECLS
#define TARGET_IMAGE_DIR_PREFIX "_"
#define SETUP_XML "setup.xml"
+#define SETUP_V2_XML "setup2.xml"
#define SETUP_NATIVE_VERSION 200 /* 2.0 */