[gnome-color-manager] Make the profiles from volumes feature a GConf configurable



commit 17770910f8aaa31e3e7a7240507786e36d32a288
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jan 19 16:48:40 2010 +0000

    Make the profiles from volumes feature a GConf configurable

 data/gnome-color-manager.schemas.in |   28 +++++++++++++++++++++++++---
 src/gcm-profile-store.c             |   10 +++++++++-
 src/gcm-utils.h                     |    1 +
 3 files changed, 35 insertions(+), 4 deletions(-)
---
diff --git a/data/gnome-color-manager.schemas.in b/data/gnome-color-manager.schemas.in
index 446e848..07b5f29 100644
--- a/data/gnome-color-manager.schemas.in
+++ b/data/gnome-color-manager.schemas.in
@@ -11,8 +11,10 @@
         <short>The default gamma to use for monitors with no previous selection.</short>
         <long>
           Gamma is adjusted to affect the color of the attached monitor.
-          Traditionally Linux has used a gamma value of 1.0, but this makes monitors look washed out compared Windows XP or OSX.
-          Apple traditionally used a value of 1.8 for a long time, but now use the same value as Microsoft.
+          Traditionally Linux has used a gamma value of 1.0, but this makes
+          monitors look washed out compared Windows XP or OSX.
+          Apple traditionally used a value of 1.8 for a long time, but now use
+          the same value as Microsoft.
           Microsoft has always used a value of 2.2.</long>
       </locale>
     </schema>
@@ -30,6 +32,23 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/gnome-color-manager/use_profiles_from_volumes</key>
+      <applyto>/apps/gnome-color-manager/use_profiles_from_volumes</applyto>
+      <owner>gnome-color-manager</owner>
+      <type>bool</type>
+      <default>true</default>
+      <locale name="C">
+        <short>If ICC profiles should be loaded from external disks.</short>
+        <long>
+          If set to TRUE then external disks are searched for device ICC profiles
+          at startup, for instance looking in the OSX library folder or
+          Windows XP system folders.
+          This may increase startup time if disks need to be spun-up to be searched.
+        </long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/gnome-color-manager/set_icc_profile_atom</key>
       <applyto>/apps/gnome-color-manager/set_icc_profile_atom</applyto>
       <owner>gnome-color-manager</owner>
@@ -37,7 +56,10 @@
       <default>true</default>
       <locale name="C">
         <short>Set the _ICC_PROFILE atom for applications.</short>
-        <long>If set to TRUE then the __ICC_PROFILE atom will be set, which applications use to convert true color to screen color.</long>
+        <long>
+          If set to TRUE then the __ICC_PROFILE atom will be set, which
+          applications use to convert true color to screen color.
+        </long>
       </locale>
     </schema>
 
diff --git a/src/gcm-profile-store.c b/src/gcm-profile-store.c
index 9df3aff..d789b6f 100644
--- a/src/gcm-profile-store.c
+++ b/src/gcm-profile-store.c
@@ -31,6 +31,7 @@
 
 #include <glib-object.h>
 #include <gio/gio.h>
+#include <gconf/gconf-client.h>
 
 #include "gcm-profile-store.h"
 #include "gcm-utils.h"
@@ -55,6 +56,7 @@ struct _GcmProfileStorePrivate
 	GPtrArray			*monitor_array;
 	GPtrArray			*directory_array;
 	GVolumeMonitor			*volume_monitor;
+	GConfClient			*gconf_client;
 };
 
 enum {
@@ -396,6 +398,8 @@ static void
 gcm_profile_store_add_profiles (GcmProfileStore *profile_store)
 {
 	gchar *path;
+	gboolean ret;
+	GcmProfileStorePrivate *priv = profile_store->priv;
 
 	/* get OSX and Linux system-wide profiles */
 	gcm_profile_store_add_profiles_for_path (profile_store, "/usr/share/color/icc");
@@ -403,7 +407,9 @@ gcm_profile_store_add_profiles (GcmProfileStore *profile_store)
 	gcm_profile_store_add_profiles_for_path (profile_store, "/Library/ColorSync/Profiles/Displays");
 
 	/* get OSX and Windows system-wide profiles when using Linux */
-	gcm_profile_store_add_profiles_from_mounted_volumes (profile_store);
+	ret = gconf_client_get_bool (priv->gconf_client, GCM_SETTINGS_USE_PROFILES_FROM_VOLUMES, NULL);
+	if (ret)
+		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);
@@ -475,6 +481,7 @@ gcm_profile_store_init (GcmProfileStore *profile_store)
 	profile_store->priv->profile_array = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
 	profile_store->priv->monitor_array = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
 	profile_store->priv->directory_array = g_ptr_array_new_with_free_func ((GDestroyNotify) g_free);
+	profile_store->priv->gconf_client = gconf_client_get_default ();
 
 	/* watch for volumes to be connected */
 	profile_store->priv->volume_monitor = g_volume_monitor_get ();
@@ -500,6 +507,7 @@ gcm_profile_store_finalize (GObject *object)
 	g_ptr_array_unref (priv->monitor_array);
 	g_ptr_array_unref (priv->directory_array);
 	g_object_unref (priv->volume_monitor);
+	g_object_unref (priv->gconf_client);
 
 	G_OBJECT_CLASS (gcm_profile_store_parent_class)->finalize (object);
 }
diff --git a/src/gcm-utils.h b/src/gcm-utils.h
index 93749b7..67a8f79 100644
--- a/src/gcm-utils.h
+++ b/src/gcm-utils.h
@@ -40,6 +40,7 @@
 #define GCM_SETTINGS_RENDERING_INTENT_SOFTPROOF	"/apps/gnome-color-manager/rendering_intent_softproof"
 #define GCM_SETTINGS_COLORSPACE_RGB		"/apps/gnome-color-manager/colorspace_rgb"
 #define GCM_SETTINGS_COLORSPACE_CMYK		"/apps/gnome-color-manager/colorspace_cmyk"
+#define GCM_SETTINGS_USE_PROFILES_FROM_VOLUMES	"/apps/gnome-color-manager/use_profiles_from_volumes"
 
 gboolean	 gcm_utils_set_gamma_for_device		(GcmDevice		*device,
 							 GError			**error);



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