diff options
author | Peter Williams <peterw@src.gnome.org> | 2000-09-06 04:08:10 +0800 |
---|---|---|
committer | Peter Williams <peterw@src.gnome.org> | 2000-09-06 04:08:10 +0800 |
commit | b1e66c4c60ca6d52c0a164a510e5199ca201bf98 (patch) | |
tree | 8a3bdab58ee5ba9a3374c77fa867bd19585a05ed /camel/providers/imap | |
parent | a86c7ea0ab3775cc8fb141c1792c3b2bdb663a34 (diff) | |
download | gsoc2013-evolution-b1e66c4c60ca6d52c0a164a510e5199ca201bf98.tar.gz gsoc2013-evolution-b1e66c4c60ca6d52c0a164a510e5199ca201bf98.tar.zst gsoc2013-evolution-b1e66c4c60ca6d52c0a164a510e5199ca201bf98.zip |
Cleanup of lots of exception handling ; bugfixes
svn path=/trunk/; revision=5202
Diffstat (limited to 'camel/providers/imap')
-rw-r--r-- | camel/providers/imap/camel-imap-folder.c | 10 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 14 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-store.h | 3 |
3 files changed, 20 insertions, 7 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index c4c26db300..5b55f6bf9a 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -191,11 +191,21 @@ camel_imap_folder_new (CamelStore *parent, char *folder_name, CamelException *ex CF_CLASS (folder)->init (folder, parent, NULL, folder_name, dir_sep, FALSE, ex); + if (camel_exception_is_set (ex)) { + camel_object_unref (CAMEL_OBJECT (folder)); + return NULL; + } + if (!strcmp (folder_name, url->path + 1)) folder->can_hold_messages = FALSE; CF_CLASS (folder)->refresh_info (folder, ex); + if (camel_exception_is_set (ex)) { + camel_object_unref (CAMEL_OBJECT (folder)); + return NULL; + } + return folder; } diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index 820c2453ce..5ffdd51d4b 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -95,7 +95,8 @@ camel_imap_store_init (gpointer object, gpointer klass) service->url_flags |= (CAMEL_SERVICE_URL_NEED_USER | CAMEL_SERVICE_URL_NEED_HOST | - CAMEL_SERVICE_URL_ALLOW_PATH); + CAMEL_SERVICE_URL_ALLOW_PATH | + CAMEL_SERVICE_URL_ALLOW_AUTH); imap_store->dir_sep = g_strdup ("/"); /*default*/ imap_store->current_folder = NULL; @@ -231,6 +232,7 @@ imap_connect (CamelService *service, CamelException *ex) errbuf = g_strdup_printf ("Unable to authenticate to IMAP server.\n" "%s\n\n", camel_exception_get_description (ex)); + camel_exception_clear (ex); } else { g_message ("IMAP Service sucessfully authenticated user %s", service->url->user); authenticated = TRUE; @@ -280,8 +282,10 @@ imap_connect (CamelService *service, CamelException *ex) } g_free (result); - - return TRUE; + + camel_remote_store_refresh_folders (CAMEL_REMOTE_STORE (store), ex); + + return ! camel_exception_is_set (ex); } static gboolean @@ -336,7 +340,6 @@ imap_folder_exists (CamelFolder *folder, CamelException *ex) &result, ex, "EXAMINE %s", folder_path); if (status != CAMEL_IMAP_OK) { - g_free (result); g_free (folder_path); return FALSE; } @@ -439,6 +442,9 @@ get_folder (CamelStore *store, const char *folder_name, gboolean create, CamelEx new_folder = camel_imap_folder_new (store, folder_path, ex); + if (camel_exception_is_set (ex)) + return NULL; + /* this is the top-level dir, we already know it exists - it has to! */ if (!strcmp (folder_name, dir_sep)) return new_folder; diff --git a/camel/providers/imap/camel-imap-store.h b/camel/providers/imap/camel-imap-store.h index 7aa911f394..2b946f065c 100644 --- a/camel/providers/imap/camel-imap-store.h +++ b/camel/providers/imap/camel-imap-store.h @@ -50,7 +50,6 @@ typedef struct { CamelRemoteStore parent_object; CamelFolder *current_folder; - CamelStream *istream, *ostream; guint32 command; @@ -58,8 +57,6 @@ typedef struct { gboolean has_status_capability; gchar *dir_sep; - - guint timeout_id; } CamelImapStore; |