evolution-data-server r10183 - trunk/camel/providers/groupwise
- From: pchen svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r10183 - trunk/camel/providers/groupwise
- Date: Thu, 19 Mar 2009 06:08:38 +0000 (UTC)
Author: pchen
Date: Thu Mar 19 06:08:38 2009
New Revision: 10183
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=10183&view=rev
Log:
Fixes #480091.
Modified:
trunk/camel/providers/groupwise/ChangeLog
trunk/camel/providers/groupwise/camel-groupwise-folder.c
trunk/camel/providers/groupwise/camel-groupwise-store.c
trunk/camel/providers/groupwise/camel-groupwise-store.h
Modified: trunk/camel/providers/groupwise/camel-groupwise-folder.c
==============================================================================
--- trunk/camel/providers/groupwise/camel-groupwise-folder.c (original)
+++ trunk/camel/providers/groupwise/camel-groupwise-folder.c Thu Mar 19 06:08:38 2009
@@ -1243,13 +1243,12 @@
if (!check_all && slist && g_slist_length(slist) != 0)
check_all = TRUE;
+ if (gw_store->current_folder != folder)
+ groupwise_store_set_current_folder (gw_store, folder);
+
g_slist_free (slist);
slist = NULL;
- if (gw_store->current_folder != folder) {
- gw_store->current_folder = folder;
- }
-
if (check_all && !is_proxy) {
EGwContainer *container;
int i=0;
@@ -2426,7 +2425,7 @@
camel_folder_summary_touch (source->summary);
camel_folder_summary_touch (destination->summary);
- gw_store->current_folder = source;
+ groupwise_store_set_current_folder (gw_store, source);
CAMEL_SERVICE_REC_UNLOCK (source->parent_store, connect_lock);
}
Modified: trunk/camel/providers/groupwise/camel-groupwise-store.c
==============================================================================
--- trunk/camel/providers/groupwise/camel-groupwise-store.c (original)
+++ trunk/camel/providers/groupwise/camel-groupwise-store.c Thu Mar 19 06:08:38 2009
@@ -258,6 +258,26 @@
}
+/* resets the current folder. To just free current folder, pass NULL for folder */
+void
+groupwise_store_set_current_folder (CamelGroupwiseStore *groupwise_store, CamelFolder *folder)
+{
+
+ CAMEL_SERVICE_REC_LOCK (groupwise_store, connect_lock);
+
+ if (groupwise_store->current_folder) {
+ camel_object_unref (groupwise_store->current_folder);
+ groupwise_store->current_folder = NULL;
+ }
+
+ if (folder) {
+ camel_object_ref (folder);
+ groupwise_store->current_folder = folder;
+ }
+
+ CAMEL_SERVICE_REC_UNLOCK (groupwise_store, connect_lock);
+}
+
static gboolean
groupwise_connect (CamelService *service, CamelException *ex)
{
@@ -391,10 +411,7 @@
groupwise_store->priv->cnc = NULL;
}
- if (groupwise_store->current_folder) {
- camel_object_unref (groupwise_store->current_folder);
- groupwise_store->current_folder = NULL;
- }
+ groupwise_store_set_current_folder (groupwise_store, NULL);
CAMEL_SERVICE_REC_UNLOCK (groupwise_store, connect_lock);
}
@@ -549,8 +566,7 @@
folder = groupwise_get_folder_from_disk (store, folder_name, flags, ex);
if (folder) {
- camel_object_ref (folder);
- gw_store->current_folder = folder;
+ groupwise_store_set_current_folder (gw_store, folder);
return folder;
}
@@ -558,11 +574,7 @@
CAMEL_SERVICE_REC_LOCK (gw_store, connect_lock);
- if (gw_store->current_folder) {
- camel_object_unref (gw_store->current_folder);
- gw_store->current_folder = NULL;
- }
-
+ groupwise_store_set_current_folder (gw_store, NULL);
if (!camel_groupwise_store_connected (gw_store, ex)) {
CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
@@ -675,8 +687,7 @@
camel_folder_summary_save_to_db (folder->summary, ex);
- camel_object_ref (folder);
- gw_store->current_folder = folder;
+ groupwise_store_set_current_folder (gw_store, folder);
g_free (container_id);
CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
@@ -795,7 +806,7 @@
camel_folder_summary_save_to_db (folder->summary, ex);
- gw_store->current_folder = folder;
+ groupwise_store_set_current_folder (gw_store, NULL);
g_free (container_id);
CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
@@ -1302,10 +1313,7 @@
status = e_gw_connection_remove_item (priv->cnc, container, container);
if (status == E_GW_CONNECTION_STATUS_OK) {
- if (groupwise_store->current_folder) {
- camel_object_unref (groupwise_store->current_folder);
- groupwise_store->current_folder = NULL;
- }
+ groupwise_store_set_current_folder (groupwise_store, NULL);
groupwise_forget_folder(groupwise_store,folder_name,ex);
@@ -1342,10 +1350,7 @@
return;
}
- if (groupwise_store->current_folder) {
- camel_object_unref (groupwise_store->current_folder);
- groupwise_store->current_folder = NULL;
- }
+ groupwise_store_set_current_folder (groupwise_store, NULL);
container_id = camel_groupwise_store_container_id_lookup (groupwise_store, old_name);
temp_new = strrchr (new_name, '/');
Modified: trunk/camel/providers/groupwise/camel-groupwise-store.h
==============================================================================
--- trunk/camel/providers/groupwise/camel-groupwise-store.h (original)
+++ trunk/camel/providers/groupwise/camel-groupwise-store.h Thu Mar 19 06:08:38 2009
@@ -79,6 +79,7 @@
CamelFolderInfo * create_junk_folder (CamelStore *store);
gboolean camel_groupwise_store_connected (CamelGroupwiseStore *store, CamelException *ex);
void gw_store_reload_folder (CamelGroupwiseStore *store, CamelFolder *folder, guint32 flags, CamelException *ex);
+void groupwise_store_set_current_folder (CamelGroupwiseStore *groupwise_store, CamelFolder *folder);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]