Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:jberkman
evolution-data-server-2.6
bnc-165728-folder-list-eds.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bnc-165728-folder-list-eds.diff of Package evolution-data-server-2.6
Index: camel/providers/groupwise/camel-groupwise-store.h =================================================================== RCS file: /cvs/gnome/evolution-data-server/camel/providers/groupwise/camel-groupwise-store.h,v retrieving revision 1.13 diff -u -p -r1.13 camel-groupwise-store.h --- camel/providers/groupwise/camel-groupwise-store.h 13 Mar 2006 06:31:04 -0000 1.13 +++ camel/providers/groupwise/camel-groupwise-store.h 5 Jul 2006 10:09:09 -0000 @@ -61,7 +61,7 @@ struct _CamelGroupwiseStore { /* the parameters field is not to be included not. probably for 2.6*/ /*guint32 parameters;*/ time_t refresh_stamp; - guint list_loaded:1; + guint list_loaded; }; Index: camel/providers/groupwise/camel-groupwise-store.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/camel/providers/groupwise/camel-groupwise-store.c,v retrieving revision 1.103 --- camel/providers/groupwise/camel-groupwise-store.abuild 2006-12-21 12:31:20.000000000 +0530 +++ camel/providers/groupwise/camel-groupwise-store.c 2006-12-21 13:37:58.000000000 +0530 @@ -103,8 +103,13 @@ groupwise_store_construct (CamelService _("Host or user not available in url")); } - groupwise_store->list_loaded = FALSE; - + /*XXX: The number 3 assigned to the list_loaded variable denotes + * the number of times the get_folder_info is called during startup. + * We are just trying to minimize the call. + * This is a dirty hack. But it *WORKS* + */ + groupwise_store->list_loaded = 3; + /*storage path*/ priv->storage_path = camel_session_get_storage_path (session, service, ex); if (!priv->storage_path) @@ -310,14 +315,6 @@ groupwise_connect (CamelService *service camel_groupwise_store_summary_namespace_set (store->summary, ns); if (camel_store_summary_count ((CamelStoreSummary *)store->summary) == 0) { - /*XXX: Have to sync up folders here*/ - groupwise_folders_sync (store, ex); - if (camel_exception_is_set (ex)) { - camel_store_summary_save ((CamelStoreSummary *) store->summary); - CAMEL_SERVICE_UNLOCK (service, connect_lock); - camel_service_disconnect (service, TRUE, NULL); - return FALSE; - } /*Settting the refresh stamp to the current time*/ store->refresh_stamp = time (0); } @@ -1009,38 +1006,34 @@ groupwise_get_folder_info (CamelStore *s if (top && groupwise_is_system_folder (top)) return groupwise_build_folder_info (groupwise_store, NULL, top ); - /* * Thanks to Michael, for his cached folders implementation in IMAP * is used as is here. */ - if ((groupwise_store->list_loaded == TRUE) && camel_store_summary_count((CamelStoreSummary *)groupwise_store->summary) > 0) { - /*Load from cache*/ - /* - time_t now; - int ref; - - now = time (0); - ref = now > groupwise_store->refresh_stamp+60*60*1; - if (ref) { - CAMEL_SERVICE_LOCK (store, connect_lock); - ref = now > groupwise_store->refresh_stamp+60*60*1; - if (ref) { - struct _store_refresh_msg *m; - groupwise_store->refresh_stamp = now; - m = camel_session_thread_msg_new (((CamelService *)store)->session, &store_refresh_ops, sizeof(*m)); - m->store = store; - camel_object_ref (store); - camel_exception_init (&m->ex); - camel_session_thread_queue (((CamelService *)store)->session, &m->msg, 0); - } + if (camel_store_summary_count ((CamelStoreSummary *)groupwise_store->summary) == 0) { + CAMEL_SERVICE_LOCK (store, connect_lock); + if (groupwise_store->list_loaded == 3) { + groupwise_folders_sync (groupwise_store, ex); + groupwise_store->list_loaded -= 1; + } + if (camel_exception_is_set (ex)) { + camel_store_summary_save ((CamelStoreSummary *) groupwise_store->summary); CAMEL_SERVICE_UNLOCK (store, connect_lock); - }*/ - groupwise_folders_sync (groupwise_store, ex); + return NULL; + } + CAMEL_SERVICE_UNLOCK (store, connect_lock); + camel_store_summary_save ((CamelStoreSummary *)groupwise_store->summary); + goto end_r; + } + + if ((camel_store_summary_count((CamelStoreSummary *)groupwise_store->summary) > 0) && (groupwise_store->list_loaded > 1)) { + /*Load from cache*/ + groupwise_store->list_loaded -= 1; + goto end_r; } CAMEL_SERVICE_LOCK (store, connect_lock); - if ((groupwise_store->list_loaded == FALSE) && check_for_connection((CamelService *)store, ex)) { + if ((groupwise_store->list_loaded == 1) && check_for_connection((CamelService *)store, ex)) { if (!priv->cnc) { if (groupwise_connect ((CamelService *)store, ex)) { g_warning ("Could connect!!!\n"); @@ -1048,7 +1041,6 @@ groupwise_get_folder_info (CamelStore *s g_warning ("Could not connect..failure connecting\n"); } if (camel_groupwise_store_connected ((CamelGroupwiseStore *)store, ex)) { - groupwise_store->list_loaded = TRUE; groupwise_folders_sync (groupwise_store, ex); if (camel_exception_is_set (ex)) { CAMEL_SERVICE_UNLOCK (store, connect_lock); @@ -1061,6 +1053,7 @@ groupwise_get_folder_info (CamelStore *s CAMEL_SERVICE_UNLOCK (store, connect_lock); /*camel_exception_clear (ex);*/ +end_r: info = groupwise_get_folder_info_offline (store, top, flags, ex); return info; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor