summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2010-07-19 18:09:31 +0200
committerTomas Bzatek <tbzatek@redhat.com>2010-07-19 18:09:31 +0200
commitf81a4d4628a7b9cd27293ade19ae6649b4a55e45 (patch)
treef53a54933a52b155a3df0614c5bace84aef7492f /src
parentd9dd375a6d6090274fde3d57b30788195f48755a (diff)
downloadcataract-f81a4d4628a7b9cd27293ade19ae6649b4a55e45.tar.xz
Silence error messages when searching for setup file
Also print the setup file path in verbose mode.
Diffstat (limited to 'src')
-rw-r--r--src/cgg.c4
-rw-r--r--src/setup.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/src/cgg.c b/src/cgg.c
index 5d6c9d4..5950825 100644
--- a/src/cgg.c
+++ b/src/cgg.c
@@ -164,8 +164,10 @@ main (int argc, char* argv[])
stats_images = 0;
/* Print banner */
- if (verbose)
+ if (verbose) {
printf ("cgg v%s [%s]\n\n", VERSION, APP_BUILD_DATE);
+ printf ("Using setup file \"%s\"\n", setup->setup_xml_path);
+ }
/* Start building the gallery tree */
setup->verbose = verbose;
diff --git a/src/setup.c b/src/setup.c
index 7f7caf9..f394838 100644
--- a/src/setup.c
+++ b/src/setup.c
@@ -27,6 +27,7 @@
#include <libxml/xpathInternals.h>
#include <glib.h>
+#include <glib/gstdio.h>
#include <config.h>
@@ -46,23 +47,27 @@ find_setup_xml (TGallerySetup *setup)
gchar *cwd;
gboolean b;
+ b = FALSE;
cwd = g_get_current_dir ();
pth = g_strconcat (cwd, "/", SETUP_XML, NULL);
g_free (cwd);
- b = parse_setup_xml (pth, setup);
+ if (g_access (pth, R_OK) == 0)
+ b = parse_setup_xml (pth, setup);
g_free (pth);
if (b)
return TRUE;
pth = g_strconcat (g_getenv ("HOME"), "/.cgg/", SETUP_XML, NULL);
- b = parse_setup_xml (pth, setup);
+ if (g_access (pth, R_OK) == 0)
+ b = parse_setup_xml (pth, setup);
g_free (pth);
if (b)
return TRUE;
pth = g_strconcat (DATADIR, "/cgg/", SETUP_XML, NULL);
- b = parse_setup_xml (pth, setup);
+ if (g_access (pth, R_OK) == 0)
+ b = parse_setup_xml (pth, setup);
g_free (pth);
return b;
}