[gnome-color-manager] Don't fail to show the device if the profile was deleted



commit 6f8ca3aa744ff6f11b4f4aa2cb6f879d5898eeaf
Author: Richard Hughes <richard hughsie com>
Date:   Thu Nov 5 15:09:16 2009 +0000

    Don't fail to show the device if the profile was deleted

 src/gcm-device.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-device.c b/src/gcm-device.c
index 2aeb282..70eec65 100644
--- a/src/gcm-device.c
+++ b/src/gcm-device.c
@@ -118,6 +118,15 @@ gcm_device_load_from_profile (GcmDevice *device, GError **error)
 	/* load the profile if it's set */
 	if (device->priv->profile != NULL) {
 
+		/* if the profile was deleted */
+		ret = g_file_test (device->priv->profile, G_FILE_TEST_EXISTS);
+		if (!ret) {
+			egg_warning ("the file was deleted and can't be loaded: %s", device->priv->profile);
+			/* this is not fatal */
+			ret = TRUE;
+			goto out;
+		}
+
 		/* create new profile instance */
 		profile = gcm_profile_new ();
 		ret = gcm_profile_parse (profile, device->priv->profile, &error_local);



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