[evolution-data-server] Removed folders from connection when operations gets done - handles when jobs return back without ex
- From: Chenthill Palanisamy <pchen src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Removed folders from connection when operations gets done - handles when jobs return back without ex
- Date: Tue, 13 Jul 2010 19:56:22 +0000 (UTC)
commit 135f4f5be01d367f97f73341611137025cb8001c
Author: Chenthill Palanisamy <pchenthill novell com>
Date: Wed Jul 14 01:22:13 2010 +0530
Removed folders from connection when operations gets done - handles when jobs return back without executing
camel/providers/imapx/camel-imapx-conn-manager.c | 37 +++++++++++++++++++++-
camel/providers/imapx/camel-imapx-conn-manager.h | 3 ++
camel/providers/imapx/camel-imapx-folder.c | 6 +++
camel/providers/imapx/camel-imapx-store.c | 1 +
4 files changed, 46 insertions(+), 1 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-conn-manager.c b/camel/providers/imapx/camel-imapx-conn-manager.c
index 669ff8a..fb134bc 100644
--- a/camel/providers/imapx/camel-imapx-conn-manager.c
+++ b/camel/providers/imapx/camel-imapx-conn-manager.c
@@ -160,7 +160,7 @@ imapx_conn_update_select (CamelIMAPXServer *conn, const gchar *selected_folder,
jinfo = camel_imapx_server_get_job_queue_info (cinfo->conn);
if (!g_hash_table_lookup (jinfo->folders, cinfo->selected_folder)) {
g_hash_table_remove (cinfo->folders, cinfo->selected_folder);
- c(printf ("Removed folder %s from connection folder list \n", cinfo->selected_folder));
+ c(printf ("Removed folder %s from connection folder list - select changed \n", cinfo->selected_folder));
}
camel_imapx_destroy_job_queue_info (jinfo);
g_free (cinfo->selected_folder);
@@ -328,6 +328,41 @@ camel_imapx_conn_manager_get_connections (CamelIMAPXConnManager *con_man)
return conns;
}
+/* Used for handling operations that fails to execute and that needs to removed from folder list */
+void
+camel_imapx_conn_manager_update_con_info (CamelIMAPXConnManager *con_man, CamelIMAPXServer *conn,
+ const gchar *folder_name)
+{
+ GSList *l;
+ ConnectionInfo *cinfo;
+ gboolean found = FALSE;
+
+ g_return_if_fail (CAMEL_IS_IMAPX_CONN_MANAGER (con_man));
+
+ CON_LOCK(con_man);
+
+ for (l = con_man->priv->connections; l != NULL; l = g_slist_next (l)) {
+ cinfo = (ConnectionInfo *) l->data;
+ if (cinfo->conn == conn) {
+ found = TRUE;
+ break;
+ }
+ }
+
+ if (found) {
+ IMAPXJobQueueInfo *jinfo;
+
+ jinfo = camel_imapx_server_get_job_queue_info (cinfo->conn);
+ if (!g_hash_table_lookup (jinfo->folders, folder_name)) {
+ g_hash_table_remove (cinfo->folders, folder_name);
+ c(printf ("Removed folder %s from connection folder list - op done \n", folder_name));
+ }
+ camel_imapx_destroy_job_queue_info (jinfo);
+ }
+
+ CON_UNLOCK(con_man);
+}
+
void
camel_imapx_conn_manager_close_connections (CamelIMAPXConnManager *con_man)
{
diff --git a/camel/providers/imapx/camel-imapx-conn-manager.h b/camel/providers/imapx/camel-imapx-conn-manager.h
index 6bd17dc..afadfb8 100644
--- a/camel/providers/imapx/camel-imapx-conn-manager.h
+++ b/camel/providers/imapx/camel-imapx-conn-manager.h
@@ -65,5 +65,8 @@ CamelIMAPXServer * camel_imapx_conn_manager_get_connection (CamelIMAPXConnManag
GError **error);
void camel_imapx_conn_manager_close_connections (CamelIMAPXConnManager *con_man);
GSList * camel_imapx_conn_manager_get_connections (CamelIMAPXConnManager *con_man);
+void camel_imapx_conn_manager_update_con_info (CamelIMAPXConnManager *con_man,
+ CamelIMAPXServer *server,
+ const gchar *folder_name);
#endif /* ! _CAMEL_IMAPX_SERVER_H */
diff --git a/camel/providers/imapx/camel-imapx-folder.c b/camel/providers/imapx/camel-imapx-folder.c
index 7255334..c3f80d6 100644
--- a/camel/providers/imapx/camel-imapx-folder.c
+++ b/camel/providers/imapx/camel-imapx-folder.c
@@ -167,6 +167,7 @@ imapx_refresh_info (CamelFolder *folder, GError **error)
server = camel_imapx_store_get_server(istore, camel_folder_get_full_name (folder), error);
if (server != NULL) {
success = camel_imapx_server_refresh_info(server, folder, error);
+ camel_imapx_store_op_done (istore, server, camel_folder_get_full_name (folder));
g_object_unref(server);
}
@@ -189,6 +190,7 @@ imapx_expunge (CamelFolder *folder, GError **error)
server = camel_imapx_store_get_server(istore, camel_folder_get_full_name (folder), error);
if (server) {
camel_imapx_server_expunge(server, folder, error);
+ camel_imapx_store_op_done (istore, server, camel_folder_get_full_name (folder));
g_object_unref(server);
return TRUE;
}
@@ -219,6 +221,7 @@ imapx_sync (CamelFolder *folder, gboolean expunge, GError **error)
if (server && expunge)
camel_imapx_server_expunge(server, folder, NULL);
if (server) {
+ camel_imapx_store_op_done (istore, server, camel_folder_get_full_name (folder));
g_object_unref(server);
}
@@ -263,6 +266,7 @@ imapx_get_message (CamelFolder *folder, const gchar *uid, GError **error)
server = camel_imapx_store_get_server(istore, camel_folder_get_full_name (folder), error);
if (server) {
stream = camel_imapx_server_get_message(server, folder, uid, error);
+ camel_imapx_store_op_done (istore, server, camel_folder_get_full_name (folder));
g_object_unref(server);
} else
return NULL;
@@ -302,6 +306,7 @@ imapx_sync_message (CamelFolder *folder, const gchar *uid, GError **error)
return FALSE;
success = camel_imapx_server_sync_message (server, folder, uid, error);
+ camel_imapx_store_op_done (istore, server, camel_folder_get_full_name (folder));
g_object_unref(server);
return success;
@@ -326,6 +331,7 @@ imapx_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
server = camel_imapx_store_get_server (istore, camel_folder_get_full_name (source), error);
if (server) {
success = camel_imapx_server_copy_message (server, source, dest, uids, delete_originals, error);
+ camel_imapx_store_op_done (istore, server, camel_folder_get_full_name (source));
g_object_unref(server);
}
diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
index b140bf9..50afd80 100644
--- a/camel/providers/imapx/camel-imapx-store.c
+++ b/camel/providers/imapx/camel-imapx-store.c
@@ -242,6 +242,7 @@ camel_imapx_store_op_done (CamelIMAPXStore *istore, CamelIMAPXServer *server, co
{
g_return_if_fail (server != NULL);
+ camel_imapx_conn_manager_update_con_info (istore->con_man, server, folder_name);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]