From f81a4d4628a7b9cd27293ade19ae6649b4a55e45 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 19 Jul 2010 18:09:31 +0200 Subject: Silence error messages when searching for setup file Also print the setup file path in verbose mode. --- src/setup.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/setup.c') 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 #include +#include #include @@ -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; } -- cgit v1.2.3