[evolution] Bug 332115 - Remove Camel module names from Send/Receive window



commit 43c8c058a9449363d20470cb10889147a4613632
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Jul 12 10:21:44 2012 -0400

    Bug 332115 - Remove Camel module names from Send/Receive window

 mail/mail-send-recv.c |   41 ++++++++++++++---------------------------
 1 files changed, 14 insertions(+), 27 deletions(-)
---
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 500e17e..95e17ac 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -384,33 +384,20 @@ format_url (CamelService *service)
 
 	g_return_val_if_fail (provider != NULL, NULL);
 
-	if (display_name != NULL && *display_name != '\0') {
-		if (host != NULL && *host != '\0')
-			pretty_url = g_markup_printf_escaped (
-				"<b>%s (%s)</b>: %s",
-				display_name, provider->protocol, host);
-		else if (path != NULL)
-			pretty_url = g_markup_printf_escaped (
-				"<b>%s (%s)</b>: %s",
-				display_name, provider->protocol, path);
-		else
-			pretty_url = g_markup_printf_escaped (
-				"<b>%s (%s)</b>",
-				display_name, provider->protocol);
-
-	} else {
-		if (host != NULL && *host != '\0')
-			pretty_url = g_markup_printf_escaped (
-				"<b>%s</b>: %s",
-				provider->protocol, host);
-		else if (path != NULL)
-			pretty_url = g_markup_printf_escaped (
-				"<b>%s</b>: %s",
-				provider->protocol, path);
-		else
-			pretty_url = g_markup_printf_escaped (
-				"<b>%s</b>", provider->protocol);
-	}
+	/* This should never happen, but if the service has no
+	 * display name, fall back to the generic service name. */
+	if (display_name == NULL || *display_name == '\0')
+		display_name = camel_service_get_name (service, TRUE);
+
+	if (host != NULL && *host != '\0')
+		pretty_url = g_markup_printf_escaped (
+			"<b>%s</b>: %s", display_name, host);
+	else if (path != NULL)
+		pretty_url = g_markup_printf_escaped (
+			"<b>%s</b>: %s", display_name, path);
+	else
+		pretty_url = g_markup_printf_escaped (
+			"<b>%s</b>", display_name);
 
 	return pretty_url;
 }



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