aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-07-20 00:14:28 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-07-20 00:16:12 +0800
commitd5fdb6c72e9499c1c04d40094ccadee25d36b30c (patch)
tree9f26ca36b717af23c635f33ec6cd0473f4fdc9aa
parent75eae13cbc39577ab33b008c93707cb6ac66dc89 (diff)
downloadgsoc2013-evolution-d5fdb6c72e9499c1c04d40094ccadee25d36b30c.tar.gz
gsoc2013-evolution-d5fdb6c72e9499c1c04d40094ccadee25d36b30c.tar.zst
gsoc2013-evolution-d5fdb6c72e9499c1c04d40094ccadee25d36b30c.zip
Shorten user names with '@' in Send & Receive window.
-rw-r--r--mail/mail-send-recv.c13
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;
}