From ae7687b83a6599556b0151bb9b2fe4a598af2ccc Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 6 Nov 2008 18:40:58 +0000 Subject: [PATCH] ** Fix for bug #555979 2008-11-06 Milan Crha ** Fix for bug #555979 * camel-store.c: (ignore_no_such_table_exception): New helper function. * camel-store.c: (store_sync): Ignore 'no such table' exceptions. svn path=/trunk/; revision=9733 --- camel/ChangeLog | 7 +++++++ camel/camel-store.c | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index 5de5ce0..90b3870 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2008-11-06 Milan Crha + + ** Fix for bug #555979 + + * camel-store.c: (ignore_no_such_table_exception): New helper function. + * camel-store.c: (store_sync): Ignore 'no such table' exceptions. + 2008-10-31 Matthew Barnes ** Fixes part of bug #558727 (patch by Frederic van Starbmann) diff --git a/camel/camel-store.c b/camel/camel-store.c index 1b33a40..95fd9cf 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -700,6 +700,17 @@ camel_store_get_junk (CamelStore *store, CamelException *ex) return camel_store_get_folder(store, CAMEL_VJUNK_NAME, 0, ex); } +/** + * ignore_no_such_table_exception: + * Clears the exception 'ex' when it's the 'no such table' exception. + **/ +static void +ignore_no_such_table_exception (CamelException *ex) +{ + if (ex && camel_exception_is_set (ex) && g_ascii_strncasecmp (camel_exception_get_description (ex), "no such table", 13) == 0) + camel_exception_clear (ex); +} + static void store_sync (CamelStore *store, int expunge, CamelException *ex) { @@ -716,9 +727,10 @@ store_sync (CamelStore *store, int expunge, CamelException *ex) for (i=0;ilen;i++) { folder = folders->pdata[i]; if (!CAMEL_IS_VEE_FOLDER(folder) - && !camel_exception_is_set(&x)) + && !camel_exception_is_set(&x)) { camel_folder_sync(folder, expunge, &x); - else if (CAMEL_IS_VEE_FOLDER(folder)) + ignore_no_such_table_exception (&x); + } else if (CAMEL_IS_VEE_FOLDER(folder)) camel_vee_folder_sync_headers(folder, NULL); /* Literally don't care of vfolder exceptions */ camel_object_unref(folder); } -- 2.7.4