[gnome-color-manager] trivial: Ensure we create the _path_ (not the URI) we built with g_build_filename



commit cf247a481f3a955f8a744f0ab376d14bf73cf8a2
Author: Richard Hughes <richard hughsie com>
Date:   Thu Feb 18 17:55:16 2010 +0000

    trivial: Ensure we create the _path_ (not the URI) we built with g_build_filename

 src/gcm-prefs.c         |    1 +
 src/gcm-profile-store.c |   10 ++++++++--
 src/gcm-utils.c         |    4 ++--
 3 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index 6beae93..d5a37cc 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -586,6 +586,7 @@ gcm_prefs_drag_data_received_cb (GtkWidget *widget, GdkDragContext *context, gin
 			continue;
 
 		/* check this is an ICC profile */
+		egg_debug ("trying to import %s", filenames[i]);
 		file = g_file_new_for_uri (filenames[i]);
 		ret = gcm_utils_is_icc_profile (file);
 		if (!ret) {
diff --git a/src/gcm-profile-store.c b/src/gcm-profile-store.c
index 7b48aa0..746317b 100644
--- a/src/gcm-profile-store.c
+++ b/src/gcm-profile-store.c
@@ -406,6 +406,7 @@ gcm_profile_store_add_profiles (GcmProfileStore *profile_store)
 {
 	gchar *path;
 	gboolean ret;
+	GError *error;
 	GcmProfileStorePrivate *priv = profile_store->priv;
 
 	/* get OSX and Linux system-wide profiles */
@@ -420,8 +421,13 @@ gcm_profile_store_add_profiles (GcmProfileStore *profile_store)
 
 	/* get Linux per-user profiles */
 	path = g_build_filename (g_get_home_dir (), ".color", "icc", NULL);
-	gcm_utils_mkdir_with_parents (path, NULL);
-	gcm_profile_store_add_profiles_for_path (profile_store, path);
+	ret = gcm_utils_mkdir_with_parents (path, &error);
+	if (!ret) {
+		egg_error ("failed to create directory on startup: %s", error->message);
+		g_error_free (error);
+	} else {
+		gcm_profile_store_add_profiles_for_path (profile_store, path);
+	}
 	g_free (path);
 
 	/* get OSX per-user profiles */
diff --git a/src/gcm-utils.c b/src/gcm-utils.c
index 078750e..03cd6c0 100644
--- a/src/gcm-utils.c
+++ b/src/gcm-utils.c
@@ -248,8 +248,8 @@ gcm_utils_mkdir_with_parents (const gchar *filename, GError **error)
 	/* ensure desination exists */
 	ret = g_file_test (filename, G_FILE_TEST_EXISTS);
 	if (!ret) {
-		file = g_file_new_for_uri (filename);
-		ret = g_file_make_directory_with_parents  (file, NULL, error);
+		file = g_file_new_for_path (filename);
+		ret = g_file_make_directory_with_parents (file, NULL, error);
 		if (!ret)
 			goto out;
 	}



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