aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorBertrand Guiheneuf <bertrand@src.gnome.org>1999-09-22 05:21:36 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-09-22 05:21:36 +0800
commit10da3f1841a9902268920e17819f95bd40e9d854 (patch)
treea07c8b6d243e2158ce0115f11fb42811e02b2730 /camel
parenta8ccf540137ec5fa18a00a0a8f4819ab43806a30 (diff)
downloadgsoc2013-evolution-10da3f1841a9902268920e17819f95bd40e9d854.tar.gz
gsoc2013-evolution-10da3f1841a9902268920e17819f95bd40e9d854.tar.zst
gsoc2013-evolution-10da3f1841a9902268920e17819f95bd40e9d854.zip
more work.
* camel/camel-folder-pt-proxy.c: more work. svn path=/trunk/; revision=1248
Diffstat (limited to 'camel')
-rw-r--r--camel/camel-folder-pt-proxy.c87
-rw-r--r--camel/camel-folder.c1
2 files changed, 82 insertions, 6 deletions
diff --git a/camel/camel-folder-pt-proxy.c b/camel/camel-folder-pt-proxy.c
index 289c02ddcf..7d54de9479 100644
--- a/camel/camel-folder-pt-proxy.c
+++ b/camel/camel-folder-pt-proxy.c
@@ -523,7 +523,7 @@ _async_open (gpointer param)
open_folder_param = (_OpenFolderParam *)param;
- folder =open_folder_param->folder;
+ folder = open_folder_param->folder;
CF_CLASS (folder)->open (folder, open_folder_param->mode);
g_free (param);
@@ -555,28 +555,100 @@ _open (CamelFolder *folder, CamelFolderOpenMode mode)
/* folder->close implementation */
+typedef struct {
+ CamelFolder *folder;
+ gboolean expunge;
+} _CloseFolderParam;
+
+static void
+_async_close (gpointer param)
+{
+ _CloseFolderParam *close_folder_param;
+ CamelFolder *folder;
+
+ close_folder_param = (_CloseFolderParam *)param;
+
+ folder = close_folder_param->folder;
+
+ CF_CLASS (folder)->close (folder, close_folder_param->expunge);
+ g_free (param);
+ _notify_availability (folder, 'a');
+
+}
+
static void
_close (CamelFolder *folder, gboolean expunge)
{
- if (expunge) camel_folder_expunge (folder, FALSE);
- folder->open_state = FOLDER_CLOSE;
+ CamelFolderPtProxy *proxy_folder = CAMEL_FOLDER_PT_PROXY (folder);
+ _CloseFolderParam *param;
+ CamelOp *op;
+
+ op = camel_op_new ();
+
+ param = g_new (_CloseFolderParam, 1);
+ param->folder = proxy_folder->real_folder;
+ param->expunge = expunge;
+
+ op->func = _async_close;
+ op->param = param;
+
+ _op_exec_or_plan_for_exec (proxy_folder, op);
}
+/* folder->set_name implementation */
+
+typedef struct {
+ CamelFolder *folder;
+ const gchar *name;
+} _SetNameFolderParam;
+
+static void
+_async_set_name (gpointer param)
+{
+ _SetNameFolderParam *set_name_folder_param;
+ CamelFolder *folder;
+
+ set_name_folder_param = (_SetNameFolderParam *)param;
+
+ folder = set_name_folder_param->folder;
+
+ CF_CLASS (folder)->set_name (folder, set_name_folder_param->expunge);
+ g_free (param);
+ _notify_availability (folder, 'a');
+
+}
static void
_set_name (CamelFolder *folder, const gchar *name)
{
+ CamelFolderPtProxy *proxy_folder = CAMEL_FOLDER_PT_PROXY (folder);
+ _SetNameFolderParam *param;
+ CamelOp *op;
+ op = camel_op_new ();
+
+ param = g_new (_SetNameFolderParam, 1);
+ param->folder = proxy_folder->real_folder;
+ param->name = name;
+
+ op->func = _async_set_name;
+ op->param = param;
+
+ _op_exec_or_plan_for_exec (proxy_folder, op);
}
-
+/* folder->get_name implementation */
+/* this one i not executed in a thread */
static const gchar *
_get_name (CamelFolder *folder)
{
- return folder->name;
+ CamelFolderPtProxy *proxy_folder = CAMEL_FOLDER_PT_PROXY (folder);
+
+ return CF_CLASS (proxy_folder->real_folder)->
+ get_name (proxy_folder->real_folder);
}
@@ -585,7 +657,10 @@ _get_name (CamelFolder *folder)
static const gchar *
_get_full_name (CamelFolder *folder)
{
- return folder->full_name;
+ CamelFolderPtProxy *proxy_folder = CAMEL_FOLDER_PT_PROXY (folder);
+
+ return CF_CLASS (proxy_folder->real_folder)->
+ get_full_name (proxy_folder->real_folder);
}
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 26308879d6..5fb9b6a29a 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -877,6 +877,7 @@ _get_message (CamelFolder *folder, gint number)
CamelMimeMessage *
camel_folder_get_message (CamelFolder *folder, gint number)
{
+#warning this code has nothing to do here.
CamelMimeMessage *a_message;
CamelMimeMessage *new_message = NULL;
GList *message_node;