[gnome-color-manager] trivial: if GConf is not setup (or broken), ensure the rendering intent combobox displays something



commit 2a7e3f925329123966a5e0a8e8b77d99376ea22c
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jan 12 11:26:59 2010 +0000

    trivial: if GConf is not setup (or broken), ensure the rendering intent combobox displays something

 src/gcm-prefs.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/gcm-prefs.c b/src/gcm-prefs.c
index 73774a6..b77ce76 100644
--- a/src/gcm-prefs.c
+++ b/src/gcm-prefs.c
@@ -2429,15 +2429,21 @@ static void
 gcm_prefs_setup_rendering_combobox (GtkWidget *widget, const gchar *intent)
 {
 	guint i;
+	gboolean ret = FALSE;
 	const gchar *text;
 
 	for (i=1; i<GCM_RENDERING_INTENT_LAST; i++) {
 		text = gcm_rendering_intent_to_localized_text (i);
 		gtk_combo_box_append_text (GTK_COMBO_BOX (widget), text);
 		text = gcm_rendering_intent_to_text (i);
-		if (g_strcmp0 (text, intent) == 0)
+		if (g_strcmp0 (text, intent) == 0) {
+			ret = TRUE;
 			gtk_combo_box_set_active (GTK_COMBO_BOX (widget), i-1);
+		}
 	}
+	/* nothing matches, just set the first option */
+	if (!ret)
+		gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
 }
 
 /**



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