diff options
author | Dan Winship <danw@src.gnome.org> | 2000-07-02 07:07:18 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-07-02 07:07:18 +0800 |
commit | 98753e92d2b6bb52978c2ac9d38d29b8d2372978 (patch) | |
tree | 89bb98c0ad5d252931f0e65c9db1d904c8324d96 /camel/camel-service.c | |
parent | 6dabd2bd964e2e6692fa01261104fe4a510a0fa8 (diff) | |
download | gsoc2013-evolution-98753e92d2b6bb52978c2ac9d38d29b8d2372978.tar gsoc2013-evolution-98753e92d2b6bb52978c2ac9d38d29b8d2372978.tar.gz gsoc2013-evolution-98753e92d2b6bb52978c2ac9d38d29b8d2372978.tar.bz2 gsoc2013-evolution-98753e92d2b6bb52978c2ac9d38d29b8d2372978.tar.lz gsoc2013-evolution-98753e92d2b6bb52978c2ac9d38d29b8d2372978.tar.xz gsoc2013-evolution-98753e92d2b6bb52978c2ac9d38d29b8d2372978.tar.zst gsoc2013-evolution-98753e92d2b6bb52978c2ac9d38d29b8d2372978.zip |
New method, to return an end-user-friendly name corresponding to a
* camel-service.c (camel_service_get_name): New method, to return
an end-user-friendly name corresponding to a service. (eg, "POP
service for danw on trna.helixcode.com").
* providers/imap/camel-imap-store.c,
providers/mbox/camel-mbox-store.c,
providers/nntp/camel-nntp-store.c,
providers/pop3/camel-pop3-store.c,
providers/sendmail/camel-sendmail-transport.c,
providers/smtp/camel-smtp-transport.c: Implement.
svn path=/trunk/; revision=3851
Diffstat (limited to 'camel/camel-service.c')
-rw-r--r-- | camel/camel-service.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/camel/camel-service.c b/camel/camel-service.c index 1efcafcfe8..ec2e4d3712 100644 --- a/camel/camel-service.c +++ b/camel/camel-service.c @@ -41,6 +41,7 @@ static gboolean service_disconnect(CamelService *service, CamelException *ex); static gboolean is_connected (CamelService *service); static GList * query_auth_types (CamelService *service, CamelException *ex); static void free_auth_types (CamelService *service, GList *authtypes); +static char * get_name (CamelService *service, gboolean brief); static void finalize (GtkObject *object); static gboolean check_url (CamelService *service, CamelException *ex); @@ -60,6 +61,7 @@ camel_service_class_init (CamelServiceClass *camel_service_class) camel_service_class->is_connected = is_connected; camel_service_class->query_auth_types = query_auth_types; camel_service_class->free_auth_types = free_auth_types; + camel_service_class->get_name = get_name; /* virtual method overload */ gtk_object_class->finalize = finalize; @@ -262,6 +264,36 @@ camel_service_get_url (CamelService *service) } +static char * +get_name (CamelService *service, gboolean brief) +{ + g_warning ("CamelService::get_name not implemented for `%s'", + gtk_type_name (GTK_OBJECT_TYPE (service))); + return "???"; +} + +/** + * camel_service_get_name: + * @service: the service + * @brief: whether or not to use a briefer form + * + * This gets the name of the service in a "friendly" (suitable for + * humans) form. If @brief is %TRUE, this should be a brief description + * such as for use in the folder tree. If @brief is %FALSE, it should + * be a more complete and mostly unambiguous description. + * + * Return value: the description, which the caller must free. + **/ +char * +camel_service_get_name (CamelService *service, gboolean brief) +{ + g_return_val_if_fail (CAMEL_IS_SERVICE (service), NULL); + g_return_val_if_fail (service->url, NULL); + + return CSERV_CLASS (service)->get_name (service, brief); +} + + /** * camel_service_get_session: * @service: a service @@ -329,7 +361,6 @@ camel_service_free_auth_types (CamelService *service, GList *authtypes) } - /* URL utility routines */ /** |