[cheese] libcheese: effects: don't print CRITICAL errors if directory doesn't exist



commit 8254e09fe4ce21723d28f8eae02356b0b9d7a71a
Author: Raluca Elena Podiuc <ralucaelena1985 gmail com>
Date:   Wed Nov 30 07:05:24 2011 +0200

    libcheese: effects: don't print CRITICAL errors if directory doesn't exist
    
    Applications should use cheese_effect_load_effects to load the default set of effects.
    
    cheese_effect_load_effects() calls
    cheese_effect_load_effects_from_directory() with a list of predefined
    places to search for effects. Some of those directories may not exist.
    
    cheese_effect_load_effects_from_directory() shouldn't emit CRITICAL
    messages in this condition.

 libcheese/cheese-effect.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libcheese/cheese-effect.c b/libcheese/cheese-effect.c
index 796d432..847a9b6 100644
--- a/libcheese/cheese-effect.c
+++ b/libcheese/cheese-effect.c
@@ -278,7 +278,8 @@ cheese_effect_load_effects_from_directory (const gchar* directory)
   GList   *list = NULL;
 
   is_dir = g_file_test (directory, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR);
-  g_return_val_if_fail (is_dir, NULL);
+  if (!is_dir)
+    return NULL;
 
   dir = g_dir_open (directory, (guint) 0, &err);
   if (err != NULL)



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