From 214c66878a74cd361d988757160732c29c8b5696 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 3 Dec 2012 18:55:52 +0100 Subject: [PATCH] Bug #371469 - Add port to connection refused error messages --- camel/camel-network-service.c | 3 ++- camel/providers/pop3/camel-pop3-store.c | 19 +------------------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/camel/camel-network-service.c b/camel/camel-network-service.c index 2396c85..8555d25 100644 --- a/camel/camel-network-service.c +++ b/camel/camel-network-service.c @@ -110,8 +110,9 @@ network_service_connect_sync (CamelNetworkService *service, service_name, default_port, cancellable, error); if (status == -1) { + /* Translators: The first '%s' is replaced with a host name, the second '%s' with service name or port number */ g_prefix_error ( - error, _("Could not connect to %s: "), host); + error, _("Could not connect to '%s:%s': "), host, service_name ? service_name : "???"); g_object_unref (stream); stream = NULL; } diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index 187d2e5..866b79b 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -657,10 +657,7 @@ pop3_store_query_auth_types_sync (CamelService *service, { CamelServiceClass *service_class; CamelPOP3Store *store = CAMEL_POP3_STORE (service); - CamelNetworkSettings *network_settings; - CamelSettings *settings; GList *types = NULL; - gchar *host; GError *local_error = NULL; /* Chain up to parent's query_auth_types() method. */ @@ -673,25 +670,11 @@ pop3_store_query_auth_types_sync (CamelService *service, return NULL; } - settings = camel_service_ref_settings (service); - - network_settings = CAMEL_NETWORK_SETTINGS (settings); - host = camel_network_settings_dup_host (network_settings); - - g_object_unref (settings); - - if (connect_to_server (service, cancellable, NULL)) { + if (connect_to_server (service, cancellable, error)) { types = g_list_concat (types, g_list_copy (store->engine->auth)); pop3_store_disconnect_sync (service, TRUE, cancellable, NULL); - } else { - g_set_error ( - error, CAMEL_SERVICE_ERROR, - CAMEL_SERVICE_ERROR_UNAVAILABLE, - _("Could not connect to POP server %s"), host); } - g_free (host); - return types; } -- 2.7.4