diff options
author | Dan Winship <danw@src.gnome.org> | 2001-03-26 07:04:14 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2001-03-26 07:04:14 +0800 |
commit | a0b95ac74df4e058b00d23e570ffb2b018f360b8 (patch) | |
tree | 1d782e006485ff81059e4b44a649f60423db1c53 /camel | |
parent | 182c699c3909ff7e052f05259bac368b72c464f3 (diff) | |
download | gsoc2013-evolution-a0b95ac74df4e058b00d23e570ffb2b018f360b8.tar.gz gsoc2013-evolution-a0b95ac74df4e058b00d23e570ffb2b018f360b8.tar.zst gsoc2013-evolution-a0b95ac74df4e058b00d23e570ffb2b018f360b8.zip |
eh, changed my mind, put the exception back in camel_url_new()
svn path=/trunk/; revision=8934
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 6 | ||||
-rw-r--r-- | camel/camel-session.c | 8 | ||||
-rw-r--r-- | camel/camel-url.c | 7 | ||||
-rw-r--r-- | camel/camel-url.h | 2 |
4 files changed, 10 insertions, 13 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index c0161d7f5b..f05ad41461 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -3,15 +3,11 @@ * camel-url.c (camel_url_new_with_base): New URL parser with full RFC1808 relative URL support. Yum. (camel_url_new): Wrapper around camel_url_new_with_base now. - Removed the CamelException since no one ever used it... - + * tests/Makefile.am: add misc subdir * tests/misc/url.c: relative URL test cases from RFC 1808 - * camel-session.c (camel_session_get_service): Update - camel_url_new call. - 2001-03-25 Jeffrey Stedfast <fejj@ximian.com> * camel-filter-driver.c (do_copy): Don't use copy_to if the source diff --git a/camel/camel-session.c b/camel/camel-session.c index 24ca3b964d..6ec2c5f1cf 100644 --- a/camel/camel-session.c +++ b/camel/camel-session.c @@ -291,13 +291,9 @@ camel_session_get_service (CamelSession *session, const char *url_string, CamelProvider *provider; CamelService *service; - url = camel_url_new (url_string); - if (!url) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, - _("Could not parse URL `%s'"), - url_string); + url = camel_url_new (url_string, ex); + if (!url) return NULL; - } /* We need to look up the provider so we can then lookup the service in the provider's cache */ diff --git a/camel/camel-url.c b/camel/camel-url.c index 527c90da8a..bba935b7b9 100644 --- a/camel/camel-url.c +++ b/camel/camel-url.c @@ -32,6 +32,7 @@ #include <stdlib.h> #include <string.h> #include "camel-url.h" +#include "camel-exception.h" #include "camel-mime-utils.h" #include "camel-object.h" @@ -267,18 +268,22 @@ copy_param (GQuark key_id, gpointer data, gpointer user_data) /** * camel_url_new: * @url_string: a URL + * @ex: a CamelException * * Parses an absolute URL. * * Return value: a CamelURL, or %NULL. **/ CamelURL * -camel_url_new (const char *url_string) +camel_url_new (const char *url_string, CamelException *ex) { CamelURL *url = camel_url_new_with_base (NULL, url_string); if (!url->protocol) { camel_url_free (url); + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, + _("Could not parse URL `%s'"), + url_string); return NULL; } return url; diff --git a/camel/camel-url.h b/camel/camel-url.h index 0ee8066137..0146b70a2d 100644 --- a/camel/camel-url.h +++ b/camel/camel-url.h @@ -50,7 +50,7 @@ typedef struct { } CamelURL; CamelURL *camel_url_new_with_base (CamelURL *base, const char *url_string); -CamelURL *camel_url_new (const char *url_string); +CamelURL *camel_url_new (const char *url_string, CamelException *ex); char *camel_url_to_string (CamelURL *url, gboolean show_password); void camel_url_free (CamelURL *url); |