[gnome-settings-daemon] color: Do not search user-icc directories if they do not exist



commit d202016c12a574560e9e39da63abf48beca4c3f5
Author: Richard Hughes <richard hughsie com>
Date:   Sat Aug 27 15:37:21 2011 +0100

    color: Do not search user-icc directories if they do not exist
    
    This resolves https://bugzilla.gnome.org/show_bug.cgi?id=657484

 plugins/color/gcm-profile-store.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/plugins/color/gcm-profile-store.c b/plugins/color/gcm-profile-store.c
index 45bf43d..d325162 100644
--- a/plugins/color/gcm-profile-store.c
+++ b/plugins/color/gcm-profile-store.c
@@ -367,12 +367,20 @@ gcm_profile_store_enumerate_children_cb (GObject *source_object,
 static void
 gcm_profile_store_search_path (GcmProfileStore *profile_store, const gchar *path, guint depth)
 {
+        gboolean ret;
         GFile *file = NULL;
         GError *error = NULL;
         GcmProfileStoreDirHelper *helper;
 
-        /* add an inotify watch if not already added */
+        /* does path exist? */
         file = g_file_new_for_path (path);
+        ret = g_file_query_exists (file, NULL);
+        if (!ret) {
+                g_debug ("%s does not exist, so skipping", path);
+                goto out;
+        }
+
+        /* add an inotify watch if not already added */
         helper = gcm_profile_store_find_directory (profile_store, path);
         if (helper == NULL) {
                 helper = g_new0 (GcmProfileStoreDirHelper, 1);



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