evolution-data-server r9775 - in trunk/camel: . providers/imap
- From: mcrha svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r9775 - in trunk/camel: . providers/imap
- Date: Thu, 20 Nov 2008 10:17:33 +0000 (UTC)
Author: mcrha
Date: Thu Nov 20 10:17:33 2008
New Revision: 9775
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9775&view=rev
Log:
2008-11-20 Milan Crha <mcrha redhat com>
** Part of fix for bug #558883
* camel/camel-store-summary.h: (CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW):
Define new flag.
* camel/providers/imap/camel-imap-store.c: (parse_list_response_as_folder_info):
Do not strip CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW if set.
* camel/providers/imap/camel-imap-store.c: (imap_can_refresh_folder):
Check if can refresh folder based on the data in store's folder
summary, to not download whole folder content because of this.
* camel/providers/imap/camel-imap-folder.c: (imap_setv):
Set the 'check_folder' flag to store's folder summary too.
Modified:
trunk/camel/ChangeLog
trunk/camel/camel-store-summary.h
trunk/camel/providers/imap/ChangeLog
trunk/camel/providers/imap/camel-imap-folder.c
trunk/camel/providers/imap/camel-imap-store.c
Modified: trunk/camel/camel-store-summary.h
==============================================================================
--- trunk/camel/camel-store-summary.h (original)
+++ trunk/camel/camel-store-summary.h Thu Nov 20 10:17:33 2008
@@ -57,6 +57,7 @@
/* not in camle-store.h yet */
CAMEL_STORE_INFO_FOLDER_READONLY = 1<<13,
+ CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW = 1<<14,
CAMEL_STORE_INFO_FOLDER_FLAGGED = 1<<31
} CamelStoreInfoFlags;
Modified: trunk/camel/providers/imap/camel-imap-folder.c
==============================================================================
--- trunk/camel/providers/imap/camel-imap-folder.c (original)
+++ trunk/camel/providers/imap/camel-imap-folder.c Thu Nov 20 10:17:33 2008
@@ -473,6 +473,7 @@
break; }
/* imap args */
case CAMEL_IMAP_FOLDER_ARG_CHECK_FOLDER:
+ /* The internal value has precedence before the one stored in the summary. */
*arg->ca_int = ((CamelImapFolder *)object)->check_folder;
break;
/* CamelObject args */
@@ -514,8 +515,27 @@
switch (tag & CAMEL_ARG_TAG) {
case CAMEL_IMAP_FOLDER_ARG_CHECK_FOLDER:
if (((CamelImapFolder *)object)->check_folder != arg->ca_int) {
+ CamelFolder *folder = (CamelFolder *)object;
+
((CamelImapFolder *)object)->check_folder = arg->ca_int;
save = 1;
+
+ /* store both to the summary and to folder cmeta, to have this value restored correctly next time folder is fully loaded */
+ if (folder->parent_store && CAMEL_IS_IMAP_STORE (folder->parent_store)) {
+ CamelStoreInfo *si;
+ CamelStoreSummary *sm = CAMEL_STORE_SUMMARY (((CamelImapStore *)(folder->parent_store))->summary);
+
+ si = camel_store_summary_path (sm, folder->full_name);
+ if (si) {
+ if ((si->flags & CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW) != 0 ? 1 : 0 != (arg->ca_int) ? 1 : 0) {
+ si->flags = (si->flags & (~CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW)) | ((arg->ca_int) ? CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW : 0);
+ camel_store_summary_touch (sm);
+ camel_store_summary_save (sm);
+ }
+
+ camel_store_summary_info_free (sm, si);
+ }
+ }
}
break;
default:
Modified: trunk/camel/providers/imap/camel-imap-store.c
==============================================================================
--- trunk/camel/providers/imap/camel-imap-store.c (original)
+++ trunk/camel/providers/imap/camel-imap-store.c Thu Nov 20 10:17:33 2008
@@ -2385,7 +2385,7 @@
if (si == NULL)
return NULL;
- newflags = (si->info.flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) | (flags & ~CAMEL_STORE_INFO_FOLDER_SUBSCRIBED);
+ newflags = (si->info.flags & (CAMEL_STORE_INFO_FOLDER_SUBSCRIBED | CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW)) | (flags & ~CAMEL_STORE_INFO_FOLDER_SUBSCRIBED);
if (si->info.flags != newflags) {
si->info.flags = newflags;
camel_store_summary_touch((CamelStoreSummary *)imap_store->summary);
@@ -3074,12 +3074,19 @@
(camel_url_get_param (((CamelService *)store)->url, "check_all") != NULL) ||
(camel_url_get_param (((CamelService *)store)->url, "check_lsub") != NULL && (info->flags & CAMEL_FOLDER_SUBSCRIBED) != 0);
- if (!res && !camel_exception_is_set (ex)) {
- CamelFolder *folder;
+ if (!res && !camel_exception_is_set (ex) && CAMEL_IS_IMAP_STORE (store)) {
+ CamelStoreInfo *si;
+ CamelStoreSummary *sm = CAMEL_STORE_SUMMARY (((CamelImapStore *)(store))->summary);
- folder = camel_store_get_folder (store, info->full_name, 0, ex);
- if (folder && CAMEL_IS_IMAP_FOLDER (folder))
- res = CAMEL_IMAP_FOLDER (folder)->check_folder;
+ if (!sm)
+ return FALSE;
+
+ si = camel_store_summary_path (sm, info->full_name);
+ if (si) {
+ res = (si->flags & CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW) != 0 ? TRUE : FALSE;
+
+ camel_store_summary_info_free (sm, si);
+ }
}
return res;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]