From 5cb61aa42f97181881ca7d4586395f099c131228 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Tue, 16 Jul 2002 20:39:08 +0000 Subject: Clean up some improper usage of CamelExceptions (looking at 2002-07-16 Peter Williams * providers/imap/camel-imap-folder.c (imap_sync_online): Clean up some improper usage of CamelExceptions (looking at camel_exception_is_set when ex = NULL). * providers/imap/camel-imap-store.c (get_folder_online): Here too. * providers/imap/camel-imap-message-cache.c (camel_imap_message_cache_new): Nothing sets the exception so don't bother to check it at the end of this function. Prevents a warning about checking a NULL exception's value. svn path=/trunk/; revision=17482 --- camel/providers/imap/camel-imap-folder.c | 10 +++++++--- camel/providers/imap/camel-imap-message-cache.c | 5 ----- camel/providers/imap/camel-imap-store.c | 9 +++++++-- 3 files changed, 14 insertions(+), 10 deletions(-) (limited to 'camel/providers/imap') diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 8688adb8a0..2676dc1db9 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -711,11 +711,13 @@ imap_sync_online (CamelFolder *folder, CamelException *ex) CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store); CamelImapResponse *response = NULL; CamelMessageInfo *info; + CamelException local_ex; GPtrArray *matches; char *set, *flaglist; gboolean unset; int i, j, max; + camel_exception_init (&local_ex); CAMEL_IMAP_STORE_LOCK (store, command_lock); /* Find a message with changed flags, find all of the other @@ -751,7 +753,7 @@ imap_sync_online (CamelFolder *folder, CamelException *ex) camel_folder_summary_info_free (folder->summary, info); /* Note: to `unset' flags, use -FLAGS.SILENT () */ - response = camel_imap_command (store, folder, ex, + response = camel_imap_command (store, folder, &local_ex, "UID STORE %s %sFLAGS.SILENT %s", set, unset ? "-" : "", flaglist); g_free (set); @@ -760,7 +762,7 @@ imap_sync_online (CamelFolder *folder, CamelException *ex) if (response) camel_imap_response_free (store, response); - if (!camel_exception_is_set (ex)) { + if (!camel_exception_is_set (&local_ex)) { for (j = 0; j < matches->len; j++) { info = matches->pdata[j]; info->flags &= ~CAMEL_MESSAGE_FOLDER_FLAGGED; @@ -780,8 +782,10 @@ imap_sync_online (CamelFolder *folder, CamelException *ex) CAMEL_IMAP_STORE_UNLOCK (store, command_lock); /* check for an exception */ - if (camel_exception_is_set (ex)) + if (camel_exception_is_set (&local_ex)) { + camel_exception_xfer (ex, &local_ex); return; + } /* Re-lock the command_lock */ CAMEL_IMAP_STORE_LOCK (store, command_lock); diff --git a/camel/providers/imap/camel-imap-message-cache.c b/camel/providers/imap/camel-imap-message-cache.c index 0138441b3b..b29a2280ef 100644 --- a/camel/providers/imap/camel-imap-message-cache.c +++ b/camel/providers/imap/camel-imap-message-cache.c @@ -190,11 +190,6 @@ camel_imap_message_cache_new (const char *path, CamelFolderSummary *summary, } g_ptr_array_free (deletes, TRUE); - if (camel_exception_is_set (ex)) { - camel_object_unref (CAMEL_OBJECT (cache)); - return NULL; - } - return cache; } diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index f899168595..fbc6c39b31 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -1349,10 +1349,15 @@ get_folder_online (CamelStore *store, const char *folder_name, new_folder = camel_imap_folder_new (store, folder_name, folder_dir, ex); g_free (folder_dir); if (new_folder) { + CamelException local_ex; + imap_store->current_folder = new_folder; camel_object_ref (CAMEL_OBJECT (new_folder)); - camel_imap_folder_selected (new_folder, response, ex); - if (camel_exception_is_set (ex)) { + camel_exception_init (&local_ex); + camel_imap_folder_selected (new_folder, response, &local_ex); + + if (camel_exception_is_set (&local_ex)) { + camel_exception_xfer (ex, &local_ex); camel_object_unref (CAMEL_OBJECT (imap_store->current_folder)); imap_store->current_folder = NULL; camel_object_unref (CAMEL_OBJECT (new_folder)); -- cgit v1.2.3