aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mark-all-read/mark-all-read.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-07-05 05:40:28 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-07-09 02:37:52 +0800
commit137b0743ddfbd3bbc01c9813615ede91ddd9b954 (patch)
tree1d8e09ba0239eff419d432bdd8d5b521fbb727ba /plugins/mark-all-read/mark-all-read.c
parent36f1f29b9a42c56a619e031b045db5a18f2b1dd7 (diff)
downloadgsoc2013-evolution-137b0743ddfbd3bbc01c9813615ede91ddd9b954.tar.gz
gsoc2013-evolution-137b0743ddfbd3bbc01c9813615ede91ddd9b954.tar.zst
gsoc2013-evolution-137b0743ddfbd3bbc01c9813615ede91ddd9b954.zip
Migrate from CamelException to GError.
Diffstat (limited to 'plugins/mark-all-read/mark-all-read.c')
-rw-r--r--plugins/mark-all-read/mark-all-read.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/plugins/mark-all-read/mark-all-read.c b/plugins/mark-all-read/mark-all-read.c
index 826a596be6..8e7c158cc0 100644
--- a/plugins/mark-all-read/mark-all-read.c
+++ b/plugins/mark-all-read/mark-all-read.c
@@ -343,29 +343,31 @@ mark_all_as_read (CamelFolder *folder)
camel_folder_free_uids (folder, uids);
}
-static void
+static gboolean
mar_all_sub_folders (CamelStore *store,
CamelFolderInfo *fi,
- CamelException *ex)
+ GError **error)
{
while (fi) {
CamelFolder *folder;
if (fi->child) {
- mar_all_sub_folders (store, fi->child, ex);
- if (camel_exception_is_set (ex))
- return;
+ if (!mar_all_sub_folders (store, fi->child, error))
+ return FALSE;
}
- if (!(folder = camel_store_get_folder (store, fi->full_name, 0, ex)))
- return;
+ folder = camel_store_get_folder (
+ store, fi->full_name, 0, error);
+ if (folder == NULL)
+ return FALSE;
- if (!CAMEL_IS_VEE_FOLDER (folder)) {
+ if (!CAMEL_IS_VEE_FOLDER (folder))
mark_all_as_read (folder);
- }
fi = fi->next;
}
+
+ return TRUE;
}
static void
@@ -375,7 +377,6 @@ mar_got_folder (gchar *folder_uri,
{
CamelFolderInfo *folder_info;
CamelStore *parent_store;
- CamelException ex;
const gchar *full_name;
gint response;
@@ -383,17 +384,15 @@ mar_got_folder (gchar *folder_uri,
if (!folder)
return;
- camel_exception_init (&ex);
-
full_name = camel_folder_get_full_name (folder);
parent_store = camel_folder_get_parent_store (folder);
folder_info = camel_store_get_folder_info (
parent_store, full_name,
CAMEL_STORE_FOLDER_INFO_RECURSIVE |
- CAMEL_STORE_FOLDER_INFO_FAST, &ex);
+ CAMEL_STORE_FOLDER_INFO_FAST, NULL);
- if (camel_exception_is_set (&ex))
+ if (folder_info == NULL)
goto exit;
response = prompt_user (folder_info->child != NULL);
@@ -404,7 +403,7 @@ mar_got_folder (gchar *folder_uri,
if (response == MARK_ALL_READ_CURRENT_FOLDER)
mark_all_as_read (folder);
else if (response == MARK_ALL_READ_WITH_SUBFOLDERS)
- mar_all_sub_folders (parent_store, folder_info, &ex);
+ mar_all_sub_folders (parent_store, folder_info, NULL);
exit:
camel_store_free_folder_info (parent_store, folder_info);