diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-07-20 00:14:28 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-07-20 00:16:12 +0800 |
commit | d5fdb6c72e9499c1c04d40094ccadee25d36b30c (patch) | |
tree | 9f26ca36b717af23c635f33ec6cd0473f4fdc9aa /mail | |
parent | 75eae13cbc39577ab33b008c93707cb6ac66dc89 (diff) | |
download | gsoc2013-evolution-d5fdb6c72e9499c1c04d40094ccadee25d36b30c.tar gsoc2013-evolution-d5fdb6c72e9499c1c04d40094ccadee25d36b30c.tar.gz gsoc2013-evolution-d5fdb6c72e9499c1c04d40094ccadee25d36b30c.tar.bz2 gsoc2013-evolution-d5fdb6c72e9499c1c04d40094ccadee25d36b30c.tar.lz gsoc2013-evolution-d5fdb6c72e9499c1c04d40094ccadee25d36b30c.tar.xz gsoc2013-evolution-d5fdb6c72e9499c1c04d40094ccadee25d36b30c.tar.zst gsoc2013-evolution-d5fdb6c72e9499c1c04d40094ccadee25d36b30c.zip |
Shorten user names with '@' in Send & Receive window.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/mail-send-recv.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 35da6b3e59..a8bade95a1 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -369,8 +369,9 @@ format_service_name (CamelService *service) const gchar *display_name; const gchar *host = NULL; const gchar *path = NULL; - const gchar *user = NULL; gchar *pretty_url = NULL; + gchar *user = NULL; + gchar *cp; gboolean have_host = FALSE; gboolean have_path = FALSE; gboolean have_user = FALSE; @@ -384,7 +385,7 @@ format_service_name (CamelService *service) CAMEL_NETWORK_SETTINGS (settings)); have_host = (host != NULL) && (*host != '\0'); - user = camel_network_settings_get_user ( + user = camel_network_settings_dup_user ( CAMEL_NETWORK_SETTINGS (settings)); have_user = (user != NULL) && (*user != '\0'); } @@ -395,6 +396,13 @@ format_service_name (CamelService *service) have_path = (path != NULL) && (*path != '\0'); } + /* Shorten user names with '@', since multiple '@' in a + * 'user@host' label look weird. This is just supposed + * to be a hint anyway so it doesn't matter if it's not + * strictly correct. */ + if (have_user && (cp = strchr (user, '@')) != NULL) + *cp = '\0'; + g_return_val_if_fail (provider != NULL, NULL); /* This should never happen, but if the service has no @@ -422,6 +430,7 @@ format_service_name (CamelService *service) } g_free (service_name); + g_free (user); return pretty_url; } |