From 43c8c058a9449363d20470cb10889147a4613632 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 12 Jul 2012 10:21:44 -0400 Subject: Bug 332115 - Remove Camel module names from Send/Receive window --- mail/mail-send-recv.c | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) (limited to 'mail/mail-send-recv.c') diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 500e17e412..95e17ac500 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 ( - "%s (%s): %s", - display_name, provider->protocol, host); - else if (path != NULL) - pretty_url = g_markup_printf_escaped ( - "%s (%s): %s", - display_name, provider->protocol, path); - else - pretty_url = g_markup_printf_escaped ( - "%s (%s)", - display_name, provider->protocol); - - } else { - if (host != NULL && *host != '\0') - pretty_url = g_markup_printf_escaped ( - "%s: %s", - provider->protocol, host); - else if (path != NULL) - pretty_url = g_markup_printf_escaped ( - "%s: %s", - provider->protocol, path); - else - pretty_url = g_markup_printf_escaped ( - "%s", 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 ( + "%s: %s", display_name, host); + else if (path != NULL) + pretty_url = g_markup_printf_escaped ( + "%s: %s", display_name, path); + else + pretty_url = g_markup_printf_escaped ( + "%s", display_name); return pretty_url; } -- cgit