[evolution-data-server/gnome-3-6] store_synchronize_sync() cleanups.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-6] store_synchronize_sync() cleanups.
- Date: Fri, 1 Feb 2013 16:06:42 +0000 (UTC)
commit 71257132e4673566a26d8a0f9cb2e066367444bb
Author: Matthew Barnes <mbarnes redhat com>
Date: Fri Feb 1 07:42:14 2013 -0500
store_synchronize_sync() cleanups.
(cherry picked from commit ad1b7cd145c5fa5443556c17ba6e9d701c531bb7)
camel/camel-store.c | 38 +++++++++++++++++++++-----------------
1 files changed, 21 insertions(+), 17 deletions(-)
---
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 593b426..e5a1863 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -343,9 +343,8 @@ store_synchronize_sync (CamelStore *store,
GError **error)
{
GPtrArray *folders;
- CamelFolder *folder;
gboolean success = TRUE;
- gint i;
+ gint ii;
GError *local_error = NULL;
if (expunge) {
@@ -353,27 +352,32 @@ store_synchronize_sync (CamelStore *store,
CamelFolderInfo *root, *fi;
folders = g_ptr_array_new ();
- root = camel_store_get_folder_info_sync (store, NULL, CAMEL_STORE_FOLDER_INFO_RECURSIVE | CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL, NULL, NULL);
+ root = camel_store_get_folder_info_sync (
+ store, NULL,
+ CAMEL_STORE_FOLDER_INFO_RECURSIVE |
+ CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL,
+ NULL, NULL);
fi = root;
- while (fi) {
+ while (fi != NULL) {
CamelFolderInfo *next;
if ((fi->flags & CAMEL_FOLDER_NOSELECT) == 0) {
- CamelFolder *fldr;
+ CamelFolder *folder;
- fldr = camel_store_get_folder_sync (store, fi->full_name, 0, NULL, NULL);
- if (fldr)
- g_ptr_array_add (folders, fldr);
+ folder = camel_store_get_folder_sync (
+ store, fi->full_name, 0, NULL, NULL);
+ if (folder != NULL)
+ g_ptr_array_add (folders, folder);
}
/* pick the next */
next = fi->child;
- if (!next)
+ if (next == NULL)
next = fi->next;
- if (!next) {
+ if (next == NULL) {
next = fi->parent;
- while (next) {
- if (next->next) {
+ while (next != NULL) {
+ if (next->next != NULL) {
next = next->next;
break;
}
@@ -385,7 +389,7 @@ store_synchronize_sync (CamelStore *store,
fi = next;
}
- if (root)
+ if (root != NULL)
camel_store_free_folder_info_full (store, root);
} else {
/* sync only folders opened until now */
@@ -395,10 +399,10 @@ store_synchronize_sync (CamelStore *store,
/* We don't sync any vFolders, that is used to update certain
* vfolder queries mainly, and we're really only interested in
* storing/expunging the physical mails. */
- for (i = 0; i < folders->len; i++) {
- folder = folders->pdata[i];
- if (!CAMEL_IS_VEE_FOLDER (folder)
- && local_error == NULL) {
+ for (ii = 0; ii < folders->len; ii++) {
+ CamelFolder *folder = folders->pdata[ii];
+
+ if (!CAMEL_IS_VEE_FOLDER (folder) && local_error == NULL) {
camel_folder_synchronize_sync (
folder, expunge, cancellable, &local_error);
ignore_no_such_table_exception (&local_error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]