[glade] GladeCatalog: Avoid warnings when trying to access non-existant catalog paths.



commit 1049df0b5503f224bf962663d19caed84cc72749
Author: Tristan Van Berkom <tristan upstairslabs com>
Date:   Tue Dec 17 17:22:15 2013 +0900

    GladeCatalog: Avoid warnings when trying to access non-existant catalog paths.
    
    These warnings show up in bundled environments.

 gladeui/glade-catalog.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gladeui/glade-catalog.c b/gladeui/glade-catalog.c
index 39fa24a..0dc7d83 100644
--- a/gladeui/glade-catalog.c
+++ b/gladeui/glade-catalog.c
@@ -509,6 +509,10 @@ catalogs_from_path (GList *catalogs, const gchar *path)
   GError *error = NULL;
   const gchar *filename;
 
+  /* Silent return if the directory didn't exist */
+  if (!g_file_test (path, G_FILE_TEST_IS_DIR))
+    return catalogs;
+
   if ((dir = g_dir_open (path, 0, &error)) != NULL)
     {
       while ((filename = g_dir_read_name (dir)))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]