[gnome-color-manager] Use the common data path from OpenIccDirectoryProposal



commit fef750d4bed38fa68d7b07b1963758f5d8d73210
Author: Richard Hughes <richard hughsie com>
Date:   Sat May 22 08:36:09 2010 +0100

    Use the common data path from OpenIccDirectoryProposal
    
    No migration is required, the old location is searched as well.

 src/gcm-import.c        |    2 +-
 src/gcm-profile-store.c |    7 ++++++-
 src/gcm-utils.c         |    2 +-
 src/gcm-utils.h         |    1 -
 4 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/gcm-import.c b/src/gcm-import.c
index 50f9001..806fa26 100644
--- a/src/gcm-import.c
+++ b/src/gcm-import.c
@@ -202,7 +202,7 @@ main (int argc, char **argv)
 	if (response != GTK_RESPONSE_OK)
 		goto out;
 
-	/* copy icc file to ~/.color/icc */
+	/* copy icc file to users profile path */
 	ret = gcm_utils_mkdir_and_copy (file, destination, &error);
 	if (!ret) {
 		/* TRANSLATORS: could not read file */
diff --git a/src/gcm-profile-store.c b/src/gcm-profile-store.c
index a0bd735..882fc53 100644
--- a/src/gcm-profile-store.c
+++ b/src/gcm-profile-store.c
@@ -409,7 +409,7 @@ gcm_profile_store_add_profiles (GcmProfileStore *profile_store)
 		gcm_profile_store_add_profiles_from_mounted_volumes (profile_store);
 
 	/* get Linux per-user profiles */
-	path = g_build_filename (g_get_home_dir (), ".color", "icc", NULL);
+	path = g_build_filename (g_get_user_data_dir (), "icc", NULL);
 	ret = gcm_utils_mkdir_with_parents (path, &error);
 	if (!ret) {
 		egg_error ("failed to create directory on startup: %s", error->message);
@@ -419,6 +419,11 @@ gcm_profile_store_add_profiles (GcmProfileStore *profile_store)
 	}
 	g_free (path);
 
+	/* get per-user profiles from obsolete location */
+	path = g_build_filename (g_get_home_dir (), ".color", "icc", NULL);
+	gcm_profile_store_add_profiles_for_path (profile_store, path);
+	g_free (path);
+
 	/* get OSX per-user profiles */
 	path = g_build_filename (g_get_home_dir (), "Library", "ColorSync", "Profiles", NULL);
 	gcm_profile_store_add_profiles_for_path (profile_store, path);
diff --git a/src/gcm-utils.c b/src/gcm-utils.c
index 2760b75..10e3367 100644
--- a/src/gcm-utils.c
+++ b/src/gcm-utils.c
@@ -396,7 +396,7 @@ gcm_utils_get_profile_destination (GFile *file)
 
 	/* get destination filename for this source file */
 	basename = g_file_get_basename (file);
-	destination = g_build_filename (g_get_home_dir (), GCM_PROFILE_PATH, basename, NULL);
+	destination = g_build_filename (g_get_user_data_dir (), "icc", basename, NULL);
 	dest = g_file_new_for_path (destination);
 
 	g_free (basename);
diff --git a/src/gcm-utils.h b/src/gcm-utils.h
index 3f9e5e0..7c1c380 100644
--- a/src/gcm-utils.h
+++ b/src/gcm-utils.h
@@ -30,7 +30,6 @@
 #include "gcm-enum.h"
 
 #define GCM_STOCK_ICON					"gnome-color-manager"
-#define GCM_PROFILE_PATH				"/.color/icc"
 #define GCM_DBUS_SERVICE				"org.gnome.ColorManager"
 #define GCM_DBUS_INTERFACE				"org.gnome.ColorManager"
 #define GCM_DBUS_PATH					"/org/gnome/ColorManager"



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