[gnome-color-manager: 2/18] trivial: Actually show some text in the CellRendererProfile if the profile is NULL



commit 8b9fd4858bd1302cba65cac85e3d8492b22dc532
Author: Richard Hughes <richard hughsie com>
Date:   Fri Oct 8 11:12:47 2010 +0100

    trivial: Actually show some text in the CellRendererProfile if the profile is NULL

 src/gcm-cell-renderer-profile.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/src/gcm-cell-renderer-profile.c b/src/gcm-cell-renderer-profile.c
index bcaf690..af5ac7b 100644
--- a/src/gcm-cell-renderer-profile.c
+++ b/src/gcm-cell-renderer-profile.c
@@ -65,19 +65,21 @@ gcm_cell_renderer_set_markup (GcmCellRendererProfile *renderer)
 	GString *string;
 	const gchar *description;
 
-	/* not yet set */
-	if (renderer->profile == NULL)
-		return;
-
-	/* add profile description */
-	description = gcm_profile_get_description (renderer->profile);
-	if (description == NULL)
-		description = gcm_profile_get_filename (renderer->profile);
-	string = g_string_new (description);
-
-	/* TRANSLATORS: this is the default profile */
-	if (renderer->is_default)
-		g_string_append_printf (string, " [%s]", _("Default"));
+	/* do we have a profile to load? */
+	if (renderer->profile == NULL) {
+		/* TRANSLATORS: this is when there is no profile for the device */
+		string = g_string_new (_("No profile"));
+	} else {
+		/* add profile description */
+		description = gcm_profile_get_description (renderer->profile);
+		if (description == NULL)
+			description = gcm_profile_get_filename (renderer->profile);
+		string = g_string_new (description);
+
+		/* TRANSLATORS: this is the default profile */
+		if (renderer->is_default)
+			g_string_append_printf (string, " [%s]", _("Default"));
+	}
 
 	/* assign */
 	g_free (renderer->markup);



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